Image from API loading on iOS, but doesn't on Android (Compose multiplatform)

221 Views Asked by At

I'm making my first compose multiplatform app and get some problem. Getting some images from my API via Kamel and Moko MVVM. On iOS it works, but on Android doesn't. Of course network permission is given. There're no any errors.

From App.kt

@Composable
fun CarImageCell(image: CarImage) {
    KamelImage(
        asyncPainterResource(image.file),
        image.fileName,
        contentScale = ContentScale.Crop,
        modifier = Modifier.fillMaxWidth().aspectRatio(1.0f)
    )
}

From ViemModel:

private suspend fun getImages(): List<CarImage> {
        return httpClient
            .get("https://social-pears-camp.loca.lt/api/storage/CarImageViewSet/")
            .body()
    }

I've tried to turn on the app on my android phone and I had same situation, just white screen. I think I have no access to Internet from my app, but it's strange, permission is given.

1

There are 1 best solutions below

1
On

Solution was easy. I've just made a new project and all work fine.