moko-resources
moko-resources copied to clipboard
Incompatible with Android Gradle Plugin 7.3.0
After update classpath("com.android.tools.build:gradle:7.3.0") build failed:
> Task :shared:compileDebugKotlin e: /Users/.../MR.kt: (16, 74): Unresolved reference: app_name
the same issue. Is there any workaround?
Behaviour observed: a) If no other module depends on resources module (which contains MR), build fails. b) If the resources module is a dependency of some other module, for example any UI module, then the project builds successfully, however unable to access autogenerated object MR on android side. Autogenerated MR accessible in iOS code, xcode project builds and runs successfully.
After this workaround, project builds successfully, however unable to access MR on android Android fails to compile with AGP 7.3.0-beta03 #353
Could be unrelated but the warning below appeared for the first time:
Incompatible Kotlin/Native libraries
There are 3 third-party libraries attached to the project that
were compiled with an older Kotlin/Native compiler and can't be read in IDE:
Gradle: dev.icerock.moko:graphics:iosMain:0.9.0
Gradle: dev.icerock.moko:resources:appleMain:0.20.1
Gradle: dev.icerock.moko:resources:iosMain:0.20.1
Please edit Gradle buildfile(s) and specify library a version compatible
with Kotlin/Native 1.7.10-release-for-android-studio.
Then re-import the project in IDE.
Issue appeared after updating the Android GradlePlugin to 7.3.0 and Android Studio to Dolphin (2021.3.1)
Rolling back to AGP 7.2.2 as of now
rollback to android studio chipmunk helped me too
it seems downgrading to AGP 7.2.2 can fix this problem temporary
For me, adding this config solved the problem while using AGP 7.3.0
For me, adding this config solved the problem while using AGP 7.3.0
Have you tried to add new resources after upgrading AGP? For example, add a new string to the xml. For me, the MR object becomes inaccessible on Android side after applying the fix suggested by you.
Have you tried to add new resources after upgrading AGP? For example, add a new string to the xml. For me, the MR object becomes inaccessible on Android side after applying the fix suggested by you.
Yes, I can add another string, compile it and show it as text with compose.
Yes, I can add another string, compile it and show it as text with compose.
Can you please have a look at my sample project. I have applied this fix to following modules, but no success:
-
petsearch-shared:Shared - build.gradle
-
petsearch-shared:resources - build.gradle (module for shared resources)
Update: In my case, using the plugin in new Plugins DSL way has resolved the issue somehow.
plugins {
kotlin("multiplatform")
id("com.android.library")
id("dev.icerock.mobile.multiplatform-resources") version "0.20.1" // Plugins DSL way
}
Installation procedure in README demonstrates the use of legacy plugin application.
With that said, autocompletion in Android Studio (Dolphin) is not working for shared resources. You have type it yourself and then IDE recognises the resource.
Same issue here :(
same problem. I've downgraded Android Studio Dolphin to Chipmunk. Is a solution in progress? @Alex009
@In-12 response fixed my issue with AGP 7.3.0 ! Thx a lot ! https://github.com/icerockdev/moko-resources/issues/384#issuecomment-1257801201
will be released in 0.21.0