coil-kt / coil

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

Coil 3.0: Images from the network aren't loading #2634

Closed colinrtwhite closed 2 weeks ago

colinrtwhite commented 2 weeks ago

Opening this preemptively to catch incoming issue when upgrading from Coil 2.0 to 3.0. You need to add Coil 3.0's new network dependency:

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

This change was made for two reasons:

If you set a custom OkHttpClient it can be done like so:

val imageLoader = ImageLoader.Builder(context)
    .components {
        add(
            OkHttpNetworkFetcherFactory(
                callFactory = {
                    OkHttpClient()
                }
            )
        )
    }
    .build()