https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
h

Hammad Akram

09/25/2023, 7:09 AM
Hi Everyone, I am using
org.jetbrains.compose.components:components-resources
to load icons from a common source set. I am fetching the resource using
Copy code
Image(
    painter = painterResource("drawable/ic_logo.xml"),
    contentDescription = null
)
The problem is that I am able to load the icons on desktop app but on Android I am getting this error
org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: drawable/ic_logo.xml
Does anyone have the same issue?
q

Qamar A. Safadi

09/25/2023, 7:18 AM
I guess you have to put this in your shared gradle if you are missing it ourceSets["main"].resources.srcDirs("src/commonMain/drawable")
here
h

Hammad Akram

09/25/2023, 7:37 AM
I have already set srcDir but the issue is the same.
@Qamar A. Safadi A correct, the icons are working fine in an app but in previews, I get this error. Previews are broken.
3 Views