Home > Mobile >  Jetpack Compose not capturing rememberImagePainter in screenshot
Jetpack Compose not capturing rememberImagePainter in screenshot

Time:10-17

I'm using the below code from enter image description here

CodePudding user response:

doesn't give me any error message when the app crashes

This is not the case, at least in my case I got the following exception:

java.lang.IllegalArgumentException: Software rendering doesn't support hardware bitmaps

Which is a known problem in Coil, and can be fixed by specifying allowHardware(false):

Image(
    rememberImagePainter(
        data = player.playerImageUrl,
        builder = {
            allowHardware(false)
        }
    ),
    contentDescription = "..."
)
  • Related