coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.86k stars 669 forks source link

`ImageDecoderDecoder` and `GifDecoder` Unresolved #2536

Closed Sayum24 closed 1 month ago

Sayum24 commented 1 month ago

Describe the bug I'm following the documentation of version 3.0.0-rc0. I want to use Coil in our Android-Kotlin-App in a Compose-view to display a GIF. I added the following lines in my build.gradle:

implementation("io.coil-kt.coil3:coil-compose:3.0.0-rc01")
implementation("io.coil-kt.coil3:coil-network-okhttp:3.0.0-rc01")
implementation("io.coil-kt.coil3:coil-gifs:3.0.0-rc01")

And copied the following lines from the documentation:

val imageLoader = ImageLoader.Builder(LocalContext.current)
    .components {
        if (SDK_INT >= 28) {
            add(ImageDecoderDecoder.Factory())
        } else {
            add(GifDecoder.Factory())
        }
    }
    .build()
AsyncImage(
    model = "https://example.com/image.jpg",
    contentDescription = null,
)

The classes ImageDecoderDecoder and GifDecoder could not be found. How can I fix this?

Version

Sayum24 commented 1 month ago

In the changelog.md I read that ImageDecoderDecoder was renamed to AnimatedImageDecoder but it wasn't found either.

Mister-Seven commented 1 month ago

@Sayum24 change gifs to gif

Sayum24 commented 1 month ago

@Mister-Seven thanks! That fixed it. So the documentation was wrong: https://coil-kt.github.io/coil/gifs/

colinrtwhite commented 1 month ago

Whoops! Fixed here: https://github.com/coil-kt/coil/pull/2541