admin管理员组文章数量:1435271
I was trying to generate a thumbnail for a video. The video is from a link on the Internet. Here's the code I'm using to generate the thumbnail:
import coil.ImageLoader
import coil3.video.VideoFrameDecoder
val videoEnabledLoader =
ImageLoader.Builder(context)ponents {
add(VideoFrameDecoder.Factory())
}.build()
But it gives me this error:
None of the following functions can be called with the arguments supplied.
It specifically points on the add function
Here's the dependencies I am using:
implementation("io.coil-kt:coil-compose:2.5.0")
implementation("io.coil-kt.coil3:coil-video:3.0.3")
I was trying to generate a thumbnail for a video. The video is from a link on the Internet. Here's the code I'm using to generate the thumbnail:
import coil.ImageLoader
import coil3.video.VideoFrameDecoder
val videoEnabledLoader =
ImageLoader.Builder(context)ponents {
add(VideoFrameDecoder.Factory())
}.build()
But it gives me this error:
None of the following functions can be called with the arguments supplied.
It specifically points on the add function
Here's the dependencies I am using:
implementation("io.coil-kt:coil-compose:2.5.0")
implementation("io.coil-kt.coil3:coil-video:3.0.3")
Share
Improve this question
edited Nov 18, 2024 at 18:29
tyg
16.9k4 gold badges40 silver badges49 bronze badges
asked Nov 16, 2024 at 16:41
Ernest Muhumuza Ernest Muhumuza
275 bronze badges
1
- Just to rule out the obvious, did you invalidate caches in Android Studio and did a clean rebuild? – tyg Commented Nov 18, 2024 at 16:04
1 Answer
Reset to default 1You are mixing incompatible Coil versions.
For the ImageLoader.Builder
you use Coil 2.5.0, for the VideoFrameDecoder.Factory
you use 3.0.3. The reason for the compile error is that the add
function requires a
coil.decode.Decoder.Factory
but you provide a
coil3.decode.Decoder.Factory
That doesn't work.
You need to fix your gradle dependencies to use the same version for all Coil artifacts. Either downgrade to 2.5.0:
implementation("io.coil-kt:coil-compose:2.5.0")
implementation("io.coil-kt:coil-video:2.5.0")
and use
import coil.ImageLoader
import coil.decode.VideoFrameDecoder
or upgrade to 3.0.3:
implementation("io.coil-kt.coil3:coil-compose:3.0.3")
implementation("io.coil-kt.coil3:coil-video:3.0.3")
and use
import coil3.ImageLoader
import coil3.video.VideoFrameDecoder
You should probably use a variable for the Coil version and use it in the gradle dependency to mitigate the risk of version mismatches in the future, or - better yet - migrate to version catalogs.
本文标签: androidError Loading a thumbnail for a video using Coil jetpack compose kotlinStack Overflow
版权声明:本文标题:android - Error Loading a thumbnail for a video using Coil jetpack compose kotlin - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745651237a2668442.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论