You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When including the Xamarin.AndroidX.Biometric NuGet package, a Java linking conflict occurs, causing the build to fail with a “type is defined multiple times” error for androidx.collection.ArrayMapKt. This library appears to pull conflicting references from both Xamarin.AndroidX.Collection.Jvm and Xamarin.AndroidX.Collection.Ktx in a .NET 8.0 Android environment.
Steps to Reproduce
Create a new .NET MAUI 8.0 Android project.
Add the Xamarin.AndroidX.Biometric NuGet package ().
Attempt to build the Android project.
Observe that the build fails with the Java linking conflict error.
Community references suggest adding Xamarin.AndroidX.Collection, Xamarin.AndroidX.Collection.Ktx, and later versions of Xamarin.AndroidX.Biometric, but these steps have not resolved the error in the affected project.
Relevant log output
Type androidx.collection.ArrayMapKt is defined multiple times:
.../xamarin.androidx.collection.jvm/...ArrayMapKt.class,
.../xamarin.androidx.collection.ktx/...ArrayMapKt.class
Error JAVA0000: Error in ...androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class:
Type androidx.collection.ArrayMapKt is defined multiple times
...
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException
Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArrayMapKt is defined multiple times
...
See https://github.com/skolesni/Sample.XamarinAndroidXBiometric.Issue/blob/main/README.md for more information.
The text was updated successfully, but these errors were encountered:
This issue has been verified using Visual Studio 17.13.0 Preview 2.1 (9.0.21). Cannot repro on android platform. but it can reproduce on 17.13.0 Preview 2.1(8.0.100 & 8.0.3)
Just tried it as well: using VS Code, with .NET 9 it all works as intended so I'm not going to spend too much time here trying to figure out why it doesn't work on .NET 8.
Please keep in mind that .NET MAUI does not have LTS releases so there should be no reason not to update to .NET 9.
Description
When including the Xamarin.AndroidX.Biometric NuGet package, a Java linking conflict occurs, causing the build to fail with a “type is defined multiple times” error for
androidx.collection.ArrayMapKt
. This library appears to pull conflicting references from bothXamarin.AndroidX.Collection.Jvm
andXamarin.AndroidX.Collection.Ktx
in a .NET 8.0 Android environment.Steps to Reproduce
Link to public reproduction project repository
https://github.com/skolesni/Sample.XamarinAndroidXBiometric.Issue
Version with bug
8.0.100 SR10
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
.NET MAUI 8.0 for Android (targeting Android 34)
Did you find any workaround?
Community references suggest adding Xamarin.AndroidX.Collection, Xamarin.AndroidX.Collection.Ktx, and later versions of Xamarin.AndroidX.Biometric, but these steps have not resolved the error in the affected project.
Relevant log output
The text was updated successfully, but these errors were encountered: