-
Notifications
You must be signed in to change notification settings - Fork 50
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
[NET8 (MAUI)] Multiple Definitions Error In Xamarin.AndroidX.Work.Runtime 2.8.1.5 #800
Comments
Hi @sk1llsh0t I have the same problem, did you find any workaround? I have target net 8.0-android34 and it doesn't work either. |
No workaround yet. Waiting for one of the maintainers to take a look and provide a fix. |
This problem stopped my project @jonathanpeppers |
Thanks for the feedback, but read #764 first. Possible duplicate. @andersonvieiragomeslopes Why mentioning JonathanPeppers?? Without list of PackageReferences in this case not much help can be provided. |
Fixed this error in my project by directly installing the following NuGets:
|
Yes. Usually explicitly overriding transitive dependencies helps. The problem is to determine which transitive dependencies. Anyhow @czmirek thanks a lot for feedback |
Related: |
Here you go (minus the reference to the androidx package):
|
Thanks
I need those too. Those are the culprit of the problem. Try removing those and you'll see the error is gone. |
Removing those packages bring other runtime and compile time errors. The only thing that worked for me was following @czmirek comment above. I'll stick with this until we have a long term solution. Thanks! |
Workaround found. |
I have the same problem, and those packages you guys mentioned are as of now not compatible with .net 8 LTS, and I don't have a workaround yet.
|
It has nothing to do with .NET 8, but package dependencies (NuGet - Maven mapping).
In order to find workaround list your |
Thanks for replying. here's the list of Package References in my project, and a screenshot of the error.
|
@uSafi - Please install those packages (latest version) explicitly into your project. It should work. It just worked for me. I am using .Net 8. The packages are - Xamarin.AndroidX.Collection and Xamarin.AndroidX.Collection.Ktx |
Thank you, but back then, in my case, the package Xamarin.AndroidX.Fragment.Ktx worked. |
Android application type
Android for .NET (net8.0-android)
Affected platform version
VS for Mac 2022 17.6.5, .NET 8.0 (8.0.100-rc.2.23502.2), MAUI, net8.0-android
Description
In my Xamarin Forms app, I use the WorkManager class to create background Work objects to execute long running tasks. I am in the middle of converting our application over to .NET 8.0 and MAUI. When I try to build the application, I get the following error.
Error in /Users/e071324/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class: Type androidx.collection.ArraySetKt is defined multiple times: /Users/e071324/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class, /Users/e071324/.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 Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/e071324/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.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: /Users/e071324/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.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.ArraySetKt is defined multiple times: /Users/e071324/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class, /Users/e071324/.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 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:2056) 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) ... 6 more
If I remove the workmanager/work objects and the Xamarin.AndroidX.Work.Runtime 2.8.1.5 nuget package, my application compiles.
Steps to Reproduce
Did you find any workaround?
No workaround as of right now.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: