https://kotlinlang.org logo
Title
p

Prateek Kumar

05/16/2023, 8:37 AM
Is there a way to know which compose desktop code will not work in android? Like i used “loadImageBitmap” from this sample: https://github.com/JetBrains/compose-multiplatform/tree/d44114d8b92669d1a15c1e979b91d221fa5253f3/tutorials/Image_And_Icons_Manipulations It works on Desktop but gives “Unresolved reference: loadXmlImageVector” while building for Android.
a

Arjan van Wieringen

05/16/2023, 8:52 AM
Getting errors at compile time is what you’d expect right?
p

Prateek Kumar

05/16/2023, 8:59 AM
But this code should work in Android as well , Right? Because i did use some Desktop specific things like painterResource(res: String) But they work without fail. Or am i missing something
t

Timo Drick

05/25/2023, 8:08 AM
The problem is that in android they are using a different approach for managing resources. So you need to use a different imagePainter instead.
Not sure what you goal is. Because in Android the resources are often also scaled depending on device pixel density.