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

HOW TO FIX: Type androidx.collection.ArraySetKt is defined multiple times #218

Closed
criistii opened this issue Dec 15, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@criistii
Copy link
Contributor

As of version 8.0.0.1 on the nuGet, there is a conflict in Android package versions that results in:

Type androidx.collection.ArraySetKt is defined multiple times:
/Users/[user]/.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, /Users/[user]/.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.9/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-ktx.jar:androidx/collection/ArraySetKt.class
Compilation failed

Other than rolling back to previous versions, I was unable to find a good working combination.

If anyone else has this issue, a fix is possible by adding the following to your project:

<ItemGroup Condition="( '$(TargetFramework)' == 'net8.0-android' )">
	<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.2" />
	<PackageReference Include="Xamarin.AndroidX.Preference" Version="1.2.1.3" />
</ItemGroup>
@criistii criistii added the bug Something isn't working label Dec 15, 2023
@spoteau
Copy link

spoteau commented Dec 31, 2023

worked for me!

@Simplicity49
Copy link

Worked for me.
Thanks

@codeinapt
Copy link

Thanks, It worked for me.

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
None yet
Development

No branches or pull requests

5 participants