Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with Android Gradle Plugin 7.3.0 #384

Closed
softartdev opened this issue Sep 16, 2022 · 13 comments · Fixed by #439
Closed

Incompatible with Android Gradle Plugin 7.3.0 #384

softartdev opened this issue Sep 16, 2022 · 13 comments · Fixed by #439
Assignees
Labels
bug Something isn't working
Milestone

Comments

@softartdev
Copy link

softartdev commented Sep 16, 2022

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

@rustamsmax
Copy link

the same issue. Is there any workaround?

@msa1422
Copy link

msa1422 commented Sep 17, 2022

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

@Sharprender
Copy link

rollback to android studio chipmunk helped me too

@kazemcodes
Copy link

it seems downgrading to AGP 7.2.2 can fix this problem temporary

@ln-12
Copy link

ln-12 commented Sep 26, 2022

For me, adding this config solved the problem while using AGP 7.3.0

@msa1422
Copy link

msa1422 commented Sep 26, 2022

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.

@ln-12
Copy link

ln-12 commented Sep 26, 2022

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.

@msa1422
Copy link

msa1422 commented Sep 26, 2022

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)

@msa1422
Copy link

msa1422 commented Oct 3, 2022

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.

@SamCosta1
Copy link

Same issue here :(

@softcleandev
Copy link

softcleandev commented Oct 10, 2022

same problem. I've downgraded Android Studio Dolphin to Chipmunk.
Is a solution in progress? @Alex009

@Siddounet
Copy link

Siddounet commented Oct 14, 2022

@In-12 response fixed my issue with AGP 7.3.0 ! Thx a lot !
#384 (comment)

@Alex009 Alex009 added this to the 0.20.2 milestone Dec 8, 2022
@Alex009 Alex009 added the bug Something isn't working label Dec 30, 2022
@Alex009 Alex009 modified the milestones: 0.21.0, 0.21.1 Mar 3, 2023
@Alex009 Alex009 modified the milestones: 0.21.1, 0.21.0 Mar 12, 2023
@Alex009 Alex009 self-assigned this Mar 12, 2023
Alex009 added a commit that referenced this issue Mar 12, 2023
@Alex009
Copy link
Member

Alex009 commented Mar 24, 2023

will be released in 0.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
10 participants