Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error JAVA0000 - Type androidx.collection.ArraySetKt is defined multiple times

When trying to rebuild app I am migrating from Xamarin.android to MAUI, I am getting the following error.

It is not actually in the solution path, it is in the c drive under nuget\packages.

I dont know if this is important, but I noticed in the error, one path ends in: net7.0-android33.0 The other path ends in: net6.0-android31.0

Error JAVA0000

Error in C:\Users\asbissada\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class:

Type androidx.collection.ArraySetKt is defined multiple times:

C:\Users\asbissada\.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class
C:\Users\asbissada\.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.10\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArraySetKt.class

Compilation failed.

I see other JAVA0000 on SO but haven't seen this one. This is what the AndroidX packages look like (I don't see ArraySetKt in there). Although I do notice Xamarin.AndroidX.Lifecycle.Common has a warning symbol even though its on the latest version: enter image description here

like image 366
angleUr Avatar asked Dec 01 '25 09:12

angleUr


1 Answers

Try adding these nuget packages as Android dependencies:

Xamarin.AndroidX.Collection

Xamarin.AndroidX.Collection.Ktx

like image 175
Riccardo Minato Avatar answered Dec 04 '25 02:12

Riccardo Minato