BarcodeScanner.Mobile
BarcodeScanner.Mobile copied to clipboard
HOW TO FIX: Type androidx.collection.ArraySetKt is defined multiple times
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>
worked for me!
Worked for me. Thanks
Thanks, It worked for me.