Full reproducible example here
I'm working on a Jetpack Compose Multiplatform project. In my module ui-system, I have a drawable located at:
ui-system/src/commonMain/composeResources/drawable/compose-multiplatform.xml
When I try to run this code on Android using:
@Composable
fun Test() {
Image(painter = painterResource(Res.drawable.compose_multiplatform), contentDescription = null)
}
I get the following error at runtime:
Caused by: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: composeResources/reproduce.ui_system.generated.resources/drawable/compose-multiplatform.xml
at org.jetbrains.compose.resources.ResourceReader_androidKt$getPlatformResourceReader$1.getResourceAsStream(ResourceReader.android.kt:82)
at org.jetbrains.compose.resources.ResourceReader_androidKt$getPlatformResourceReader$1.read(ResourceReader.android.kt:29)
...
The file exists, the path seems correct, the reference is generated correctly as well and the module uses org.jetbrains.compose.resources. I have tried:
- Clean and Rebuild
- Check if resources are actually present
Still, the resource isn't found when running on Android (I only tested Android so far).
Has anyone encountered this issue with resources in a secondary module in Compose Multiplatform? Am I missing something?