https://kotlinlang.org logo
#compose
Title
# compose
n

Neil

11/24/2021, 10:40 AM
Hi, this may be more of a coil question, but has anyone noticed that static gifs (not animated) don’t load with the coil image loader? This only seems to be for API > 28, lower than this and the image loads . I’ve tried using the imageLoader for gifs as well as shown here: https://coil-kt.github.io/coil/gifs/ and get the same results. An example static gif can be found here:

https://d30v2pzvrfyzpo.cloudfront.net/uk/images/restaurants/106512.gif

👍 1
t

Tijs Gobbens

11/24/2021, 12:11 PM
Copy code
val imageLoader = ImageLoader.Builder(context)
    .componentRegistry {
        if (SDK_INT >= 28) {
            add(ImageDecoderDecoder(context))
        } else {
            add(GifDecoder())
        }
    }
    .build()
👍 1
n

Neil

11/24/2021, 1:14 PM
@Tijs Gobbens Thanks for the reply. Yes I tried that. An animated gif I found on the web worked, but the static gif I included above did not show any image for API > 28.
t

Tijs Gobbens

11/24/2021, 1:41 PM
just tried that image in an emulator, it did render correct:( could it be device specific issue?
n

Neil

11/24/2021, 1:56 PM
It will work for devices with API < 28 but not above, could I ask what version of android your emulator was running?
I’ve tried it on several devices and emulators running different versions of android it seems that below API 28 the static gif will load, but above this it will not.
t

Tijs Gobbens

11/24/2021, 2:41 PM
i’ve tried on a emulatir pixel3a API 30 and real pixel 3a api 31
n

Neil

11/24/2021, 3:01 PM
ok thanks, maybe something I’ve done? Not sure what?
Added a Debug logger to coil and figured it out it’s down to the fact that the URL is http and not secure: CLEARTEXT communication not permitted by network security policy
👍 1
Which applies to devices with API > 28
without the logging it fails silently
2 Views