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

Build issue with version 1.9.1 of Xamarin.AndroidX.Activity #935

Closed
LeDahu22 opened this issue Aug 13, 2024 · 6 comments
Closed

Build issue with version 1.9.1 of Xamarin.AndroidX.Activity #935

LeDahu22 opened this issue Aug 13, 2024 · 6 comments

Comments

@LeDahu22
Copy link

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

Android 10 API 29

Description

Hi,

Using the following : VS2022 17.10.5 - .Net 8.0.7 - MAUI 8.0.80 SR8 - Android 10

I've got an transitive package error when trying to upgrade these two packages from version 1.9.0.4 to 1.9.1 :

  • Xamarin.AndroidX.Activity
  • Xamarin.AndroidX.Activity.Ktx

Here are the errors :

  • Error NU1107 : version conflict detected for Xamarin.AndroidX.Collection.Jvm. Install/reference Xamarin.AndroidX.Collection.Jvm 1.4.2 directly to project NDC.Mobile to resolve this issue.
    NDC.Mobile -> Xamarin.AndroidX.Activity 1.9.1 -> Xamarin.AndroidX.Collection 1.4.2 -> Xamarin.AndroidX.Collection.Jvm (>= 1.4.2)
    NDC.Mobile -> Xamarin.AndroidX.Preference 1.2.1.8 -> Xamarin.AndroidX.Fragment.Ktx 1.8.1.1 -> Xamarin.AndroidX.Collection.Ktx 1.4.0.5 -> Xamarin.AndroidX.Collection.Jvm (>= 1.4.0.5 && < 1.4.1).

  • Warning NU1608 : Detected package version outside of dependency constraint : Xamarin.AndroidX.Lifecycle.Process 2.8.3.1 requires Xamarin.AndroidX.Lifecycle.Runtime (>= 2.8.3.1 && < 2.8.4) but version Xamarin.AndroidX.Lifecycle.Runtime 2.8.4 was resolved.

Even if I try to install the proper version of Xamarin.AndroidX.Collection.Jvm (1.4.2), it's asking me to install other version of transitive packages, which has no end and eventually doesn't fix the issue.

Thank you.

Steps to Reproduce

Create a new .NET 8 MAUI project, reference the folowing packages :

  • Xamarin.AndroidX.Activity 1.9.1
  • Xamarin.AndroidX.Activity.Ktx 1.9.1

Try to build and you should get the attached logs

Did you find any workaround?

No

Relevant log output

1>MSBUILD : java.exe error JAVA0000: Error in C:\Users\cmac\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.5\buildTransitive\net8.0-android34.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class:
1>MSBUILD : java.exe error JAVA0000: Type androidx.collection.ArrayMapKt is defined multiple times: C:\Users\cmac\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.5\buildTransitive\net8.0-android34.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, C:\Users\cmac\.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class
1>MSBUILD : java.exe error JAVA0000: Compilation failed
1>MSBUILD : java.exe error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\cmac\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.5\buildTransitive\net8.0-android34.0\..\..\jar\androidx.collection.collection-jvm.jar
1>MSBUILD : java.exe error JAVA0000: androidx/collection/ArrayMapKt.class
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:135)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.main(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)
1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\cmac\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.5\buildTransitive\net8.0-android34.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class
1>MSBUILD : java.exe error JAVA0000: 	at Version.fakeStackEntry(Version_8.2.33.java:0)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:42)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:13)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:40)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:122)
1>MSBUILD : java.exe error JAVA0000: 	... 1 more
1>MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArrayMapKt is defined multiple times: C:\Users\cmac\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.5\buildTransitive\net8.0-android34.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, C:\Users\cmac\.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:54)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:10)
1>MSBUILD : java.exe error JAVA0000: 	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.graph.m4$a.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:61)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:12)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:9)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:45)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:17)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.c(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:69)
1>MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28)
1>MSBUILD : java.exe error JAVA0000: 	... 6 more
1>MSBUILD : java.exe error JAVA0000:
@LeDahu22
Copy link
Author

My use case and the step to reproduce I provided are a bit different but I think the second one provides more useful informations.

@jpobst
Copy link
Contributor

jpobst commented Aug 13, 2024

#764

@moljac
Copy link
Member

moljac commented Aug 16, 2024

@LeDahu22 Thanks for the feedback

Please provide list of packages for further investigation.

@moljac moljac changed the title Build issue with version 1.9.1 Build issue with version 1.9.1 of Xamarin.AndroidX.Activity Aug 16, 2024
@LeDahu22
Copy link
Author

Hi @moljac The only packages I installed are the two I mentionned above.

  • Xamarin.AndroidX.Activity 1.9.1
  • Xamarin.AndroidX.Activity.Ktx 1.9.1

As for the transitive packages, there are quite a lot of it. Do you need the version for each of them ?

@moljac
Copy link
Member

moljac commented Aug 22, 2024

Alignment bump will be necessary. Like for 1.9.0

https://www.nuget.org/packages/Xamarin.AndroidX.Activity/1.9.0.4

@LeDahu22
Copy link
Author

@moljac It seems the last delivery fixed this issue for me ! Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants