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

continuation of androidx.collection.ArrayMapKt is defined multiple times #18665 #20561

Closed
sabrigo opened this issue Feb 13, 2024 · 14 comments
Closed
Labels
migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@sabrigo
Copy link

sabrigo commented Feb 13, 2024

Description

The issue returns when added another library, this library looks is not supported yet for .net 8.0

The problem I have is, i have to upgrade my xamarin project before May 2024, but lot of issues are which blocks from moving forward.

Steps to Reproduce

Steps to Reproduce
Create a new .NET MAUI APP with .NET 8.0
Include nuget package Xamarin.GooglePlayServices.Auth, Xamarin.GooglePlayServices.Identity
Compile the solution.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 34

Did you find any workaround?

No response

Relevant log output

C:\Program Files\Microsoft\jdk-11.0.10.9-hotspot\bin\java.exe -cp "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\tools\manifestmerger.jar" com.xamarin.manifestmerger.Main obj\Debug\net8.0-android34.0\android\manifestmerger.rsp 
C:\Program Files\Microsoft\jdk-11.0.10.9-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@C:\Users\sabar\AppData\Local\Temp\tmp2zwtfu.tmp" -target 1.8 -source 1.8 
C:\Program Files\Microsoft\jdk-11.0.10.9-hotspot\bin\java.exe -Xmx1G -classpath "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\tools\r8.jar" com.android.tools.r8.D8 --debug --min-api 34 --output obj\Debug\net8.0-android34.0\android\bin\ --lib "C:\Program Files (x86)\Android\android-sdk\platforms\android-34\android.jar" --lib "C:\Program Files (x86)\Android\android-sdk\platforms\android-34\optional\org.apache.http.legacy.jar" obj\Debug\net8.0-android34.0\android\bin\classes.zip "C:\Program Files\dotnet\packs\Microsoft.Android.Ref.34\34.0.52\ref\net8.0\mono.android.jar" "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\tools\java_runtime_fastdev_net6.jar" C:\Users\sabar\.nuget\packages\xamarin.jetbrains.annotations\24.1.0.1\buildTransitive\net7.0-android33.0\..\..\jar\org.jetbrains.annotations-24.1.0.jar C:\Users\sabar\.nuget\packages\xamarin.kotlin.stdlib\1.9.21.1\buildTransitive\net7.0-android33.0\..\..\jar\org.jetbrains.kotlin.kotlin-stdlib-1.9.21.jar C:\Users\sabar\.nuget\packages\xamarin.kotlin.stdlib.jdk7\1.9.21.1\buildTransitive\net7.0-android33.0\..\..\jar\org.jetbrains.kotlin.kotlin-stdlib-jdk7-1.9.21.jar C:\Users\sabar\.nuget\packages\xamarin.kotlin.stdlib.jdk8\1.9.21.1\buildTransitive\net7.0-android33.0\..\..\jar\org.jetbrains.kotlin.kotlin-stdlib-jdk8-1.9.21.jar C:\Users\sabar\.nuget\packages\xamarin.kotlinx.coroutines.core.jvm\1.7.3.3\buildTransitive\net7.0-android33.0\..\..\jar\org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.3.jar C:\Users\sabar\.nuget\packages\xamarin.kotlinx.coroutines.android\1.7.3.3\buildTransitive\net7.0-android33.0\..\..\jar\org.jetbrains.kotlinx.kotlinx-coroutines-android-1.7.3.jar C:\Users\sabar\.nuget\packages\xamarin.google.guava.listenablefuture\1.0.0.17\buildTransitive\net7.0-android33.0\..\..\jar\guava-listenablefuture.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.annotation.jvm\1.7.0.3\buildTransitive\net7.0-android33.0\..\..\jar\androidx.annotation.annotation-jvm.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.concurrent.futures\1.1.0.17\buildTransitive\net7.0-android33.0\..\..\jar\androidx.concurrent.concurrent-futures.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.2.3\buildTransitive\net7.0-android33.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.arch.core.common\2.2.0.6\buildTransitive\net7.0-android33.0\..\..\jar\androidx.arch.core.core-common.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.resourceinspection.annotation\1.0.1.7\buildTransitive\net6.0-android31.0\..\..\jar\androidx.resourceinspection.resourceinspection-annotation.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.constraintlayout.core\1.0.4.6\buildTransitive\net6.0-android31.0\..\..\jar\androidx.constraintlayout.constraintlayout-core.jar C:\Users\sabar\.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar C:\Users\sabar\.nuget\packages\xamarin.android.glide.disklrucache\4.15.1.2\buildTransitive\net6.0-android31.0\..\..\jar\disklrucache.jar C:\Users\sabar\.nuget\packages\xamarin.android.glide.annotations\4.15.1.2\buildTransitive\net6.0-android31.0\..\..\jar\annotations.jar "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.android-x64\8.0.1\runtimes\android-x64\native\libSystem.Security.Cryptography.Native.Android.jar" obj\Debug\net8.0-android34.0\lp\113\jl\classes.jar obj\Debug\net8.0-android34.0\lp\114\jl\classes.jar obj\Debug\net8.0-android34.0\lp\115\jl\classes.jar obj\Debug\net8.0-android34.0\lp\116\jl\classes.jar obj\Debug\net8.0-android34.0\lp\117\jl\classes.jar obj\Debug\net8.0-android34.0\lp\118\jl\classes.jar obj\Debug\net8.0-android34.0\lp\119\jl\classes.jar obj\Debug\net8.0-android34.0\lp\120\jl\classes.jar obj\Debug\net8.0-android34.0\lp\121\jl\classes.jar obj\Debug\net8.0-android34.0\lp\122\jl\classes.jar obj\Debug\net8.0-android34.0\lp\123\jl\classes.jar obj\Debug\net8.0-android34.0\lp\124\jl\classes.jar obj\Debug\net8.0-android34.0\lp\125\jl\classes.jar obj\Debug\net8.0-android34.0\lp\126\jl\classes.jar obj\Debug\net8.0-android34.0\lp\127\jl\classes.jar obj\Debug\net8.0-android34.0\lp\128\jl\classes.jar obj\Debug\net8.0-android34.0\lp\129\jl\classes.jar obj\Debug\net8.0-android34.0\lp\130\jl\classes.jar obj\Debug\net8.0-android34.0\lp\131\jl\classes.jar obj\Debug\net8.0-android34.0\lp\132\jl\classes.jar obj\Debug\net8.0-android34.0\lp\133\jl\classes.jar obj\Debug\net8.0-android34.0\lp\134\jl\classes.jar obj\Debug\net8.0-android34.0\lp\135\jl\classes.jar obj\Debug\net8.0-android34.0\lp\136\jl\classes.jar obj\Debug\net8.0-android34.0\lp\137\jl\classes.jar obj\Debug\net8.0-android34.0\lp\138\jl\classes.jar obj\Debug\net8.0-android34.0\lp\139\jl\classes.jar obj\Debug\net8.0-android34.0\lp\140\jl\classes.jar obj\Debug\net8.0-android34.0\lp\141\jl\classes.jar obj\Debug\net8.0-android34.0\lp\142\jl\classes.jar obj\Debug\net8.0-android34.0\lp\143\jl\classes.jar obj\Debug\net8.0-android34.0\lp\144\jl\classes.jar obj\Debug\net8.0-android34.0\lp\145\jl\classes.jar obj\Debug\net8.0-android34.0\lp\146\jl\classes.jar obj\Debug\net8.0-android34.0\lp\147\jl\classes.jar obj\Debug\net8.0-android34.0\lp\148\jl\classes.jar obj\Debug\net8.0-android34.0\lp\149\jl\classes.jar obj\Debug\net8.0-android34.0\lp\150\jl\classes.jar obj\Debug\net8.0-android34.0\lp\151\jl\classes.jar obj\Debug\net8.0-android34.0\lp\152\jl\classes.jar obj\Debug\net8.0-android34.0\lp\153\jl\classes.jar obj\Debug\net8.0-android34.0\lp\154\jl\classes.jar obj\Debug\net8.0-android34.0\lp\155\jl\classes.jar obj\Debug\net8.0-android34.0\lp\156\jl\classes.jar obj\Debug\net8.0-android34.0\lp\157\jl\classes.jar obj\Debug\net8.0-android34.0\lp\158\jl\classes.jar obj\Debug\net8.0-android34.0\lp\159\jl\classes.jar obj\Debug\net8.0-android34.0\lp\160\jl\classes.jar obj\Debug\net8.0-android34.0\lp\161\jl\classes.jar obj\Debug\net8.0-android34.0\lp\162\jl\classes.jar obj\Debug\net8.0-android34.0\lp\163\jl\classes.jar obj\Debug\net8.0-android34.0\lp\164\jl\classes.jar obj\Debug\net8.0-android34.0\lp\165\jl\classes.jar obj\Debug\net8.0-android34.0\lp\166\jl\classes.jar obj\Debug\net8.0-android34.0\lp\167\jl\classes.jar obj\Debug\net8.0-android34.0\lp\168\jl\classes.jar obj\Debug\net8.0-android34.0\lp\169\jl\classes.jar obj\Debug\net8.0-android34.0\lp\170\jl\classes.jar obj\Debug\net8.0-android34.0\lp\171\jl\classes.jar obj\Debug\net8.0-android34.0\lp\172\jl\classes.jar obj\Debug\net8.0-android34.0\lp\173\jl\classes.jar obj\Debug\net8.0-android34.0\lp\178\jl\classes.jar obj\Debug\net8.0-android34.0\lp\183\jl\classes.jar obj\Debug\net8.0-android34.0\lp\187\jl\classes.jar obj\Debug\net8.0-android34.0\lp\188\jl\classes.jar obj\Debug\net8.0-android34.0\lp\189\jl\classes.jar obj\Debug\net8.0-android34.0\lp\190\jl\classes.jar obj\Debug\net8.0-android34.0\lp\191\jl\classes.jar obj\Debug\net8.0-android34.0\lp\192\jl\classes.jar obj\Debug\net8.0-android34.0\lp\193\jl\classes.jar obj\Debug\net8.0-android34.0\lp\194\jl\classes.jar obj\Debug\net8.0-android34.0\lp\195\jl\classes.jar obj\Debug\net8.0-android34.0\lp\143\jl\libs\repackaged.jar obj\Debug\net8.0-android34.0\lp\175\jl\libs\ED64959F88B22E6D.jar obj\Debug\net8.0-android34.0\lp\176\jl\libs\2E7FD15AFA9B216B.jar obj\Debug\net8.0-android34.0\lp\184\jl\libs\93F8226F68C10818.jar obj\Debug\net8.0-android34.0\lp\185\jl\libs\F975D0960055A5E3.jar obj\Debug\net8.0-android34.0\lp\186\jl\libs\B71CFF5D5A0B3AEB.jar --map-diagnostics warning info 
2>: Error JAVA0000 java.exe: Error in C:\Users\sabar\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class:
Type androidx.collection.ArrayMapKt is defined multiple times: C:\Users\sabar\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, C:\Users\sabar\.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
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\sabar\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar
androidx/collection/ArrayMapKt.class
	at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:126)
	at com.android.tools.r8.D8.main(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:5)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\sabar\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class
	at Version.fakeStackEntry(Version_8.1.56.java:0)
	at com.android.tools.r8.M.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:5)
	at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:81)
	at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:32)
	at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:31)
	at com.android.tools.r8.utils.R0.b(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:2)
	at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:26)
	at com.android.tools.r8.D8.b(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:13)
	at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:24)
	at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:113)
	... 1 more
Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArrayMapKt is defined multiple times: C:\Users\sabar\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, C:\Users\sabar\.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
	at com.android.tools.r8.utils.O2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:21)
	at com.android.tools.r8.utils.O2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:26)
	at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:44)
	at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:10)
	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
	at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:6)
	at com.android.tools.r8.graph.b4$a.e(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:7)
	at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:58)
	at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:9)
	at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:8)
	at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:29)
	at com.android.tools.r8.D8.d(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:17)
	at com.android.tools.r8.D8.c(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:1)
	at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:28)
@sabrigo sabrigo added the t/bug Something isn't working label Feb 13, 2024
@samhouts samhouts added migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 labels Feb 13, 2024
@PureWeen
Copy link
Member

@moljac thoughts?

@moljac
Copy link
Contributor

moljac commented Feb 16, 2024

This is specific from project to project. Without PackageReferences this is wild guess.

Explained here:

dotnet/android-libraries#764

@moljac
Copy link
Contributor

moljac commented Feb 16, 2024

Similar

#14954

I just closed it.

@moljac
Copy link
Contributor

moljac commented Feb 22, 2024

@sabrigo

Would you be so kind and provide PackageReferences, please?

@Cheesebaron
Copy link
Contributor

Cheesebaron commented Feb 27, 2024

I get something similar after updating packages:

    <PackageVersion Include="Xamarin.Android.Glide" Version="4.16.0.2" />
    <PackageVersion Include="Xamarin.AndroidX.ConstraintLayout" Version="2.1.4.10" />
    <PackageVersion Include="Xamarin.Google.Android.Material" Version="1.10.0.3" />
    <PackageVersion Include="Xamarin.AndroidX.Activity" Version="1.8.2.1" />
    <PackageVersion Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.2.1" />
"D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj" (Build;SignAndroidPackage target) (1:7) ->
       (_CompileToDalvik target) -> 
         MSBUILD : java.exe error JAVA0000: Error in D:\a\1\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class: [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: Type androidx.collection.ArrayMapKt is defined multiple times: D:\a\1\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, D:\a\1\.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.10\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: Compilation failed [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: D:\a\1\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: androidx/collection/ArrayMapKt.class [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:135) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.main(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: D:\a\1\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at Version.fakeStackEntry(Version_8.2.33.java:0) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:42) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:13) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:40) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:122) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	... 1 more [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArrayMapKt is defined multiple times: D:\a\1\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.1\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, D:\a\1\.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.10\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:54) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:10) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.graph.m4$a.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:61) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:12) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:9) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:45) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:17) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.D8.c(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:69) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28) [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000: 	... 6 more [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]
       MSBUILD : java.exe error JAVA0000:  [D:\a\1\s\Playground\Playground.Droid\Playground.Droid.csproj]

I guess Xamarin.AndroidX.AppCompat indirectly pulls in Xamarin.AndroidX.Collection

@Cheesebaron
Copy link
Contributor

Adding

<PackageVersion Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.1" />

Seems to fix the issue

@moljac
Copy link
Contributor

moljac commented Feb 27, 2024

I get something similar after updating packages:

    <PackageVersion Include="Xamarin.Android.Glide" Version="4.16.0.2" />
    <PackageVersion Include="Xamarin.AndroidX.ConstraintLayout" Version="2.1.4.10" />
    <PackageVersion Include="Xamarin.Google.Android.Material" Version="1.10.0.3" />
    <PackageVersion Include="Xamarin.AndroidX.Activity" Version="1.8.2.1" />
    <PackageVersion Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.2.1" />

Is that all?

I guess Xamarin.AndroidX.AppCompat indirectly pulls in Xamarin.AndroidX.Collection

https://www.nuget.org/packages/Xamarin.AndroidX.AppCompat/1.6.1.7
https://www.nuget.org/packages/Xamarin.AndroidX.Collection/1.4.0.1

But something else must be pulling in older version and that is the reason I asked if that is all?
I work on a tool to create dependency tree/forest for both maven and nuget packages, so I can traverse and analyze those dependecies. It sohould be easier in the future to diagnose.

@Cheesebaron
Copy link
Contributor

Cheesebaron commented Feb 27, 2024

This is the full list:

    <PackageVersion Include="Azure.Storage.Blobs" Version="12.19.1" />
    <PackageVersion Include="CommandLineParser" Version="2.7.82" />
    <PackageVersion Include="coverlet.collector" Version="6.0.1" />
    <PackageVersion Include="EPPlus" Version="4.5.3.2" />
    <PackageVersion Include="FluentAssertions.Analyzers" Version="0.30.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageVersion>
    <PackageVersion Include="FluentAssertions" Version="6.12.0" />
    <PackageVersion Include="Goblinfactory.ProgressBar" Version="0.4.0" />
    <PackageVersion Include="IdentityModel.OidcClient" Version="5.2.1" />
    <PackageVersion Include="MathNet.Numerics" Version="5.0.0" />
    <PackageVersion Include="Microsoft.AppCenter.Analytics" Version="5.0.3" />
    <PackageVersion Include="Microsoft.AppCenter.Crashes" Version="5.0.3" />
    <PackageVersion Include="Microsoft.AppCenter" Version="5.0.3" />
    <PackageVersion Include="Microsoft.AspNetCore.WebSockets" Version="2.2.1" />
    <PackageVersion Include="Microsoft.AspNetCore" Version="2.2.0" />
    <PackageVersion Include="Microsoft.Azure.Storage.DataMovement" Version="2.0.4" />
    <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
    <PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.2" />
    <PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
    <PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
    <PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
    <PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
    <PackageVersion Include="Microsoft.Maui.Graphics" Version="8.0.7" />
    <PackageVersion Include="Microsoft.Maui.Essentials" Version="8.0.7" />
    <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
    <PackageVersion Include="Microsoft.SourceLink.AzureRepos.Git" Version="8.0.0" />
    <PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.0.0" />
    <PackageVersion Include="Moq" Version="4.20.70" />
    <PackageVersion Include="morelinq" Version="4.1.0" />
    <PackageVersion Include="MvvmCross.Tests" Version="9.2.0" />
    <PackageVersion Include="MvvmCross" Version="9.2.0" />
    <PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageVersion Include="NinjaNye.SearchExtensions.Soundex" Version="3.0.1" />
    <PackageVersion Include="PCLMock" Version="5.1.3" />
    <PackageVersion Include="PerfectEngine.Api" Version="2.14.107.85702" />
    <PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
    <PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
    <PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" />
    <PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
    <PackageVersion Include="Serilog.Sinks.Xamarin" Version="1.0.0" />
    <PackageVersion Include="Serilog.Sinks.Trace" Version="3.0.0" />
    <PackageVersion Include="Serilog" Version="3.1.1" />
    <PackageVersion Include="SkiaScene.TouchManipulation" Version="2.2.1" />
    <PackageVersion Include="SkiaScene" Version="1.0.0" />
    <PackageVersion Include="SkiaSharp.Views" Version="2.88.7" />
    <PackageVersion Include="SkiaSharp" Version="2.88.7" />
    <PackageVersion Include="sqlite-net-pcl" Version="1.8.116" />
    <PackageVersion Include="SQLiteNetExtensions.Async" Version="2.1.0" />
    <PackageVersion Include="SQLiteNetExtensions" Version="2.1.0" />
    <PackageVersion Include="SQLitePCLRaw.bundle_green" Version="2.1.8" />
    <PackageVersion Include="stateless" Version="5.13.0" />
    <PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
    <PackageVersion Include="System.Numerics.Vectors" Version="4.5.0" />
    <PackageVersion Include="System.Reactive" Version="6.0.0" />
    <PackageVersion Include="TrackMan.Api.Data" Version="5.3.3" />
    <PackageVersion Include="TrackMan.Api.Devices" Version="5.3.13" />
    <PackageVersion Include="TrackMan.Api.Measures" Version="1.0.35" />
    <PackageVersion Include="TrackMan.Api.Range.Abstractions" Version="3.0.298" />
    <PackageVersion Include="TrackMan.Api.Range.Gql" Version="3.0.298" />
    <PackageVersion Include="TrackMan.Graphics3D" Version="2.1.20" />
    <PackageVersion Include="TrackMan.SasTokenProvider.Models" Version="1.1.1" />
    <PackageVersion Include="TrackMan.SharedCalculator" Version="6.265.0" />
    <PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
    </PackageVersion>
    <PackageVersion Include="xunit.extensibility.execution" Version="2.7.0" />
    <PackageVersion Include="xunit" Version="2.7.0" />
    <PackageVersion Include="xunit.analyzers" Version="1.11.0" />
    <PackageVersion Include="XunitXml.TestLogger" Version="3.1.20" />
    <PackageVersion Include="ImageCaching.Nuke" Version="3.0.1" />
    <PackageVersion Include="Xamarin.Android.Glide" Version="4.16.0.2" />
    <PackageVersion Include="Xamarin.AndroidX.ConstraintLayout" Version="2.1.4.10" />
    <PackageVersion Include="Xamarin.Google.Android.Material" Version="1.10.0.3" />
    <PackageVersion Include="Xamarin.AndroidX.Activity" Version="1.8.2.1" />
    <PackageVersion Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.2.1" />
    <PackageVersion Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.1" />
    <PackageVersion Include="TrackMan.Design.VirtualGolf" Version="0.1.10" />

Not all of them are referenced in the project. What is directly referenced is:

    <PackageReference Include="MvvmCross" />
    <PackageReference Include="Serilog.Extensions.Logging" />
    <PackageReference Include="Serilog.Sinks.Async" />
    <PackageReference Include="Serilog.Sinks.Trace" />
    <PackageReference Include="Microsoft.AppCenter" />
    <PackageReference Include="Microsoft.AppCenter.Analytics" />
    <PackageReference Include="Microsoft.AppCenter.Crashes" />
    <PackageReference Include="SkiaScene" />
    <PackageReference Include="SkiaScene.TouchManipulation" />
    <PackageReference Include="stateless" />
    <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
    <PackageReference Include="Microsoft.Maui.Essentials" />
    <PackageReference Include="Xamarin.AndroidX.Activity" />
    <PackageReference Include="Xamarin.AndroidX.Activity.Ktx" />

MAUI Essentials and MvvmCross would be pulling in some other AndroidX packages I guess

@moljac
Copy link
Contributor

moljac commented Feb 27, 2024

@Cheesebaron

Thanks. I will add that lists to my tests. I hope that is OK.

How did you get the 1st list?

MAUI Essentials and MvvmCross would be pulling in some other AndroidX packages I guess

Yes.

Essentials:

Xamarin.AndroidX.Browser (>= 1.5.0.3)
Xamarin.AndroidX.Security.SecurityCrypto (>= 1.1.0.1-alpha06)
Xamarin.Google.Crypto.Tink.Android (>= 1.10.0)

MVVMCross - most likely, but not sure.

@Cheesebaron
Copy link
Contributor

Cheesebaron commented Feb 27, 2024

Feel free to use the list of deps as you like :)

The first list was just what I grabbed from the csproj for the project that was failing, but only AndroidX related packages.

These are the package refs I have in the MvvmCross package:

    <PackageReference Include="Xamarin.AndroidX.AppCompat" />
    <PackageReference Include="Xamarin.AndroidX.Fragment" />
    <PackageReference Include="Xamarin.AndroidX.Preference" />
    <PackageReference Include="Xamarin.AndroidX.ViewPager" />
    <PackageReference Include="Xamarin.Google.Android.Material" />
<PackageVersion Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.4" />
<PackageVersion Include="Xamarin.AndroidX.Fragment" Version="1.6.1.1" />
<PackageVersion Include="Xamarin.AndroidX.Preference" Version="1.2.1.1" />
 <PackageVersion Include="Xamarin.AndroidX.ViewPager" Version="1.0.0.20" />
<PackageVersion Include="Xamarin.Google.Android.Material" Version="1.9.0.3" />

There are some more if you pull in some of the other Android related MvvmCross packages such as RecyclerView:

<PackageReference Include="Xamarin.AndroidX.RecyclerView" />
<PackageVersion Include="Xamarin.AndroidX.RecyclerView" Version="1.3.1.1" />

@moljac moljac added the s/needs-info Issue needs more info from the author label Feb 27, 2024
@ghost
Copy link

ghost commented Feb 27, 2024

Hi @sabrigo. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@moljac
Copy link
Contributor

moljac commented Feb 27, 2024

Adding

<PackageVersion Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.1" />

Seems to fix the issue

@sabrigo Does this workaround solve issue for you? Please provide feedback. Thanks

@sabrigo
Copy link
Author

sabrigo commented Feb 27, 2024

@moljac this is working now. thank you.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Feb 27, 2024
@moljac
Copy link
Contributor

moljac commented Feb 27, 2024

OK. Thanks.
Closing this one.

@moljac moljac closed this as completed Feb 27, 2024
mamby added a commit to mamby/france-sante-apps that referenced this issue Mar 11, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants