Closed saravr closed 1 year ago
use
"androidMainApi"("dev.icerock.moko:resources-compose:0.20.1")
or add dependency in kotlin source set block:
kotlin {
sourceSets {
val androidMain by getting {
api("dev.icerock.moko:resources-compose:0.20.1")
}
}
}
@Alex009 thanks it worked
It's not working for me either
If I change it to "androidMainApi"("dev.icerock.moko:resources-compose:$mokoResourcesVersion")
, I get this error:
Configuration with name 'androidMainApi' not found.
If I try it with:
val androidMain by getting {
api("dev.icerock.moko:resources-compose:0.20.1")
}
...then I get this error:
e: E:\projects\ceal-chronicler\shared-ui\build.gradle.kts:30:5: Unresolved reference: androidMainApi
How do I correctly use this?
I've got a branch here where I'm trying to get this to work:
https://github.com/KiraResari/ceal-chronicler/tree/moko-resources
I've put the code for root build.gradle
into the surface build.gradle.kts
(which for me is also the project build gradle), and the code for project build.gradle
into the shared-ui/build.gradle.kts
I also encounter same issue like @KiraResari when building the project
@KiraResari you can depend from commonMain because you have only android & jvm targets. https://github.com/KiraResari/ceal-chronicler/pull/1
I followed the instructions in the README for my KMM project but got this unresolved reference error. What am I missing?
Android Gradle Plugin version 7.3.1