How do I fix this certification error while using AsyncImage from Coil on Jetpack Compose?

264 views Asked by At

I'm using Coil library for Jetpack Compose and i'm trying to show an image on the screen using AsyncImage. I'm working on an emulator.

This is the code i'm using for testing it

@Composable
@Preview
fun AsyncImageTest() {
    val imageLoader = LocalContext.current.imageLoader.newBuilder()
        .logger(DebugLogger())
        .build()
    AsyncImage(
        model = ImageRequest.Builder(LocalContext.current)
            .data("https://picsum.photos/1500/1500")
            .build(),
        imageLoader = imageLoader,
        contentDescription = null
    )
}

The image is not showing up, and when I see the error it gives me this:

 Failed - https://picsum.photos/1500/1600 - javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

I have tried this:

Updating the Emulator date and hour, since maybe the certificate was expired because of that

Trying this in the manifest: android:usesCleartextTraffic="true"

Obviously I have the android Internet permission, if anyone is wondering

0

There are 0 answers