Closed Noobicle closed 5 months ago
When restoring the NuGet packages, did you notice any particular warning ?
Sadly not. It all progresses correctly no warnings given. Until the build error that is.
Sorry, for now I didn't find an solution for this issue but I was able to reproduce it with the sample project of the plugin, so when I've got time I'll take a look into it again. Until then please let us know in case you find a solution by yourself.
Thank you for responding. It makes me happy to know it's reproducible!
I will update if I find the solution.
Sorry for the hassle and thank you for the great work.
Edit: Created a minimum repo if it helps anyone find the answer. https://github.com/Noobicle/MauiBuildErrorMin
Just got this error and deleted my bin and obj folders from root and built again. So far so good after that. Credit where credit is due.. Sorry I can't remember the exact question where/why this was recommended but this guy is on top of it.
Delete bin and obj folders from root and build again
Already tried the basics but thank you :).
I am a noob lol. Was worth mentioning. Sorry no luck
Aren't we all :)
MAUI is a beast. Good luck out there
Since I haven't heard from you in more than 30 days, I hope this issue is no longer affecting you. If it is, please reopen this issue and provide the more information so that I can look into it further. Thank you!
I am having the same issue @TobiasBuchholz , albeit slightly different error message:
0>: Error JAVA0000 java: Error in /Users/cagri/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class:
Type androidx.collection.ArrayMapKt is defined multiple times: /Users/cagri/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, /Users/cagri/.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.5/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/cagri/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar
androidx/collection/ArrayMapKt.class
at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:98)
Since I haven't heard from you in more than 30 days, I hope this issue is no longer affecting you. If it is, please reopen this issue and provide the more information so that I can look into it further. Thank you!
Hey as far as I'm aware it's still an issue.
I was just patiently waiting for you to fix it. Didn't want to bug you, I sincerly appreciate the work you've done so far and didn't want to seem ungrateful because of a small bug.
Can you reopen this issue @Noobicle ? As per Tobias's message above ?
Can you reopen this issue @Noobicle ? As per Tobias's message above ?
I'm not sure I can reopen it. At least I cannot find a option to do it anywhere.
I am having the same issue @TobiasBuchholz , albeit slightly different error message:
0>: Error JAVA0000 java: Error in /Users/cagri/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class: Type androidx.collection.ArrayMapKt is defined multiple times: /Users/cagri/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar:androidx/collection/ArrayMapKt.class, /Users/cagri/.nuget/packages/xamarin.androidx.collection.ktx/1.2.0.5/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-ktx.jar:androidx/collection/ArrayMapKt.class Compilation failed java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/cagri/.nuget/packages/xamarin.androidx.collection.jvm/1.3.0.1/buildTransitive/net6.0-android31.0/../../jar/androidx.collection.collection-jvm.jar androidx/collection/ArrayMapKt.class at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:98)
If you are using the newest version of the plugin this issue should be fixed by replacing
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
</ItemGroup>
with
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.12.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.0.1" />
</ItemGroup>
in your .csproj
file.
@Noobicle ok, I'll reopen the issue then.
Hey @Noobicle, I was able to resolve your build error by updating the underlying Xamarin.Firebase.Analytics
to the newest version. This is now released with Pluging.Firebase.Analytics 2.0.2
or Plugin.Firebase 2.0.8
. Let me know if you still encounter any problems ✌️
Hi @TobiasBuchholz , is the similar issue I mentioned above ok to be tracked on this issue ?
Hi @cagriy, if the suggested fix from above doesn't help, could you please provide a sample project that demonstrates your issue?
@TobiasBuchholz , thank you. This didn't help. Here is a sample project: https://github.com/cagriy/FirebaseTest
I basically created a fresh .NET MAUI 7 project and only added Plugin.Firebase nugget. No other coding. It builds fine for iOS but fails on Android giving the following error:
@cagriy As mentioned in the documentation, you probably need to add this packages:
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.12.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.0.1" />
</ItemGroup>
Exactly, and don't forget to restore the packages after you've added them to the .csproj
file, e.g. by running dotnet restore
.
@tranb3r , @TobiasBuchholz thanks for your help, and sorry for taking your time for something obvious.
Thanks friends for sharing how to solve this issue. I can confirm, I personally solved the BUILD issue on my .NET MAUI 8 projects by updating to the latest version of Plugin.Firebase.Analytics as mentioned by our friend @TobiasBuchholz, and applying the following ItemGroup on the .csproj file.
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.12.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.0.1" />
</ItemGroup>
Hello,
I've been using the crashalytics plugin with great sucess(Thank you!). On installing the analytics plugin I am getting the following error;
I've found the conflict appears to be between the MauiMTAdmob(https://github.com/marcojak/MauiMTAdmob) plugin and your analytics plugin.
I've tried googling to no avail do you have any recommendation on how I can fix this?
I'm quite new to MAUI/Xamarin so please forgive me if it's a really obvious solution.