https://kotlinlang.org logo
Title
j

jean

12/15/2021, 9:11 AM
I had an issue a few month ago with image loaded with coil inside a lazy list https://kotlinlang.slack.com/archives/CJLTWPH7S/p1619166350451300. I just updated my project to use
"io.coil-kt:coil-compose:1.4.0"
instead of
accompanist
and I’m back at the same problem. Images are not loading when I set them from the
items
block of the
LazyListScope
block. Do I need to change anything?
Image(
    painter = rememberImagePainter(url),
    contentDescription = stringResource(id = R.string.description),
    contentScale = ContentScale.Crop,
    modifier = Modifier
        .width(150.dp)
        .height(267.dp),
)
c

Chris Sinco [G]

12/15/2021, 5:30 PM
Hmm that is odd. I just recently used
1.4.0
and have a custom Card composable in a LazyColumn. I’m using Compose 1.1.0-beta04. Does it work if you put it in Composable and not directly in the items block?
Any errors shown in Logcat?
j

jean

12/15/2021, 8:59 PM
Well, turned out it does not work in the emulator, it works fine on real device 🤷
c

Chris Sinco [G]

12/15/2021, 11:49 PM
Oh I see. Hmm. Still, anything in Logcat that comes up for the Emulator?
j

jean

12/16/2021, 7:33 AM
No I couldn’t see anything relevant