Search code examples
androidcoil

Coil is not working with big images in Android 4.4


While I was working with Coil Library I tested the old version of Android and tried to open page where the Coil library is in use. It showed the empty images. Then I tried a different type of images (300x300, 500x300 and etc.) after all I found that if image bigger than 900x350 it is not showing with Coil Library. I tested the same scenario with Glide Library and it showed everything fine. So is there a way to fix this problem, seems to be this is a bug of the library?

This is my Coil code:

        viewHolder.image.load(imageUrl) {
            crossfade(750)
            scale(Scale.FILL)
        }

And this is Glide code where everything worked well:

    val options = RequestOptions()
            .centerCrop()
            .error(R.drawable.img_placeholder)
    Glide.with(activity)
            .load(imageUrl)
            .apply(options)
            .into(viewHolder.image)

But I don't want to use Glide because I have to install Glide only for this problem where it doesn't seem to be right.

Edit: I found something similar of my problem, but I don't know how they fixed this comment

Edit (2): Coil version: io.coil-kt:coil:0.11.0


Solution

  • So I asked coil developers and what I got:

    Using DebugLogger I was able to see this error in the logs: java.net.ConnectException: Failed to connect to www.giveacare.com.au/xyz:443. This means the device was unable to connect to the server - likely because it only supports TLS 1.2+, which Android 4.x does not. Closing this as it is not a bug with Coil.

    It seems to be that the version of Android 4.x does not support the loading of big images.

    Links to the issue: https://github.com/coil-kt/coil/issues/525