moko-resources
moko-resources copied to clipboard
Expected object 'SharedRes' has no actual declaration in module <composeApp_debug> for JVM
Expected object 'SharedRes' has no actual declaration in module <composeApp_debug> for JVM
sourceSets {
getByName("main").java.srcDirs("build/generated/moko/androidMain/src")
}
after adding this it is working but localization is not changing realtime as i change the device language from setting. i have to close app and reopen then it is working
I'm seeing a similar problem with multiplatform. The work around was:
sourceSets {
getByName("androidMain") {
kotlin.srcDir("build/generated/moko/androidMain/src")
}
}
Thank for the solution this have solve my problems too :) ✅
I think we can close this ticket ❌
Thank for the solution this have solve my problems too :) ✅
I think we can close this ticket ❌
I don't think so. This should be fixed in the plugin. The workaround shouldn't be necessary.
I'm also seeing this issue. Thanks for the workaround @ScottPierce. I agree this should have a proper fix
fix in #575
fix in https://github.com/icerockdev/moko-resources/pull/575
Don't think it's fixed because I have similar error message on 0.24.0-alpha-5:
Expected object 'MR' has no actual declaration in module <common> for JVM
In my case I have android, common, desktop source sets. On Desktop build I see this error, Android build works fine. desktopMain directory is not created at all in common/build/generated/moko. So workaround with srcSet will not work because of this.
@avently please preapre reproducer, because in our samples all works
Oh, I made a sample and after that noticed that I use dev.icerock.moko:resources-compose:0.24.0-alpha-5
but classpath("dev.icerock.moko:resources-generator:0.23.0")
. So it's completely my fault, sorry. When I specified here the latest alpha and restructured project (from resources/MR to moko-resources) I see successful build for both platforms.
Also found how to fix desktop
project build in 0.23.0:
applyDefaultHierarchyTemplate()
before sourceSets
{}` in common gradle module.
And this fixes Android build:
val androidMain by getting {
kotlin.srcDir("build/generated/moko/androidMain/src")
...
}
will be fixed in 0.24.0, please check in 0.24.0-alpha-6
should be fixed in 0.24.0-beta-1