Closed Jorgemagic closed 1 year ago
update your Android dependencies (AndrodiX and GooglePlayServices-Firebase-MLKit) to the latest, please.
Hitting the same issue (exact same log except the final line with mine being from Exoplayer.aar), have updated Android dependencies to the latest, still occurring.
Previously was hitting the similar issue here: https://github.com/xamarin/GooglePlayServicesComponents/issues/694, and adding PackageReference's to "Xamarin.AndroidX.Activity" and "Xamarin.AndroidX.Activity.Ktx" resolved it.
However now tripping up on AndroidX.Lifecycle.ClassesInfoCache$MethodReference
@Jorgemagic Did you find a workaround?
Thanks.
@trussellswitch
Thanks for the feedback. Can you post your PackageReference
[s]?
Hitting the same issue (exact same log except the final line with mine being from Exoplayer.aar), have updated Android dependencies to the latest, still occurring
Which Exoplayer?
This one: Xam.Plugins.Android.ExoPlayer?
No wonders. It does not use latest packages.
I am having a similar error, could anyone help me
Error JAVA0000: Error in /Users/ali/.nuget/packages/xamarin.androidx.lifecycle.common/2.6.1.3/buildTransitive/monoandroid12.0/../../jar/androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class: Type androidx.lifecycle.DispatchQueue is defined multiple times: /Users/ali/.nuget/packages/xamarin.androidx.lifecycle.common/2.6.1.3/buildTransitive/monoandroid12.0/../../jar/androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class, obj/Release/lp/204/jl/classes.jar:androidx/lifecycle/DispatchQueue.class Compilation failed java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/ali/.nuget/packages/xamarin.androidx.lifecycle.common/2.6.1.3/buildTransitive/monoandroid12.0/../../jar/androidx.lifecycle.lifecycle-common.jar androidx/lifecycle/DispatchQueue.class at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:98) at com.android.tools.r8.D8.main(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:4) Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/ali/.nuget/packages/xamarin.androidx.lifecycle.common/2.6.1.3/buildTransitive/monoandroid12.0/../../jar/androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class at Version.fakeStackEntry(Version_3.3.75.java:0) at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:75) at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:28) at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:27) at com.android.tools.r8.internal.Fj.b(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:2) at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:22) at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:17) at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:85) ... 1 more Caused by: com.android.tools.r8.internal.f: Type androidx.lifecycle.DispatchQueue is defined multiple times: /Users/ali/.nuget/packages/xamarin.androidx.lifecycle.common/2.6.1.3/buildTransitive/monoandroid12.0/../../jar/androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class, obj/Release/lp/204/jl/classes.jar:androidx/lifecycle/DispatchQueue.class at com.android.tools.r8.internal.JT.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:14) at com.android.tools.r8.internal.JT.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:22) at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:33) at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:10) at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048) at com.android.tools.r8.internal.HN.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:6) at com.android.tools.r8.graph.B2$a.e(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:4) at com.android.tools.r8.dex.b.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:110) at com.android.tools.r8.dex.b.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:28) at com.android.tools.r8.D8.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:25) at com.android.tools.r8.D8.d(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:606) at com.android.tools.r8.D8.c(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:1) at com.android.tools.r8.internal.Fj.a(R8_3.3.75_b7a6ff6b13548611571508fe72282c9167faa649161ca0013edfc92e19bd7e58:24) ... 5 more Directory 'obj/Release/lp/204' is from 'androidx.lifecycle.lifecycle-runtime-ktx.aar'. (JAVA0000)
@alooosh
Thanks for the feedback, but I'll need more info. Can you show me your PackageReference
s, please?
yes sure
@alooosh
Thanks for the feedback, but I'll need more info. Can you show me your
PackageReference
s, please?
@alooosh
please open your project file *.csproj
and paste text here.
... and update your packages afterwards
@alooosh please open your project file
*.csproj
and paste text here.... and update your packages afterwards
`<?xml version="1.0" encoding="utf-8"?>
@trussellswitch
Thanks for the feedback. Can you post your
PackageReference
[s]?
Hi @moljac, we manage our own ExoPlayer bindings, however I looked into it and there was a difference in packages. Xamarin.AndroidX.Annotation and Xamarin.AndroidX.Media were not using latest (but were still on .net supported versions).
Updating to latest versions in the ExoPlayer bindings resolved the issue.
Updating to latest versions in the ExoPlayer bindings resolved the issue.
@trussellswitch Thanks for the feedback.
@alooosh
All I need is PackageReferences:
<ItemGroup> <PackageReference Include="MediatR"> <Version>12.1.1</Version> </PackageReference> <PackageReference Include="PhotoBrowser.Forms"> <Version>0.1.4</Version> </PackageReference> <PackageReference Include="Plugin.Toast"> <Version>2.2.0</Version> </PackageReference> <PackageReference Include="Sharpnado.Forms.HorizontalListView"> <Version>1.8.2</Version> </PackageReference> <PackageReference Include="Sharpnado.Presentation.Forms"> <Version>1.7.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Activity"> <Version>1.7.2.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources"> <Version>1.1.0.2</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Browser"> <Version>1.4.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Fragment"> <Version>1.6.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4"> <Version>1.0.0.19</Version> </PackageReference> <PackageReference Include="Xamarin.Essentials"> <Version>1.7.7</Version> </PackageReference> <PackageReference Include="Xamarin.Google.Android.Material"> <Version>1.5.0</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.Core.UI"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.Fragment"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Rg.Plugins.Popup"> <Version>2.1.0</Version> </PackageReference> <PackageReference Include="Xamarin.GooglePlayServices.Base"> <Version>118.2.0.1</Version> </PackageReference> <PackageReference Include="RestSharp"> <Version>110.2.1-alpha.0.10</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.Messaging"> <Version>123.1.2.2</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat"> <Version>1.6.1.3</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.v7.AppCompat"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources"> <Version>1.6.1.3</Version> </PackageReference> <PackageReference Include="Xamarin.Forms"> <Version>5.0.0.2515</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Core"> <Version>1.9.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.CustomView"> <Version>1.1.0.18</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Preference"> <Version>1.2.0</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.RecyclerView"> <Version>1.3.0</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Navigation.UI"> <Version>2.3.5.5</Version> </PackageReference> <PackageReference Include="Xamarin.GooglePlayServices.Ads"> <Version>121.2.0</Version> </PackageReference> </ItemGroup> <ItemGroup>
from brief look at it you have 2 huge potential problems:
using Xamarin.AndroidX.AppCompat.Resources
which is deprecated
https://www.nuget.org/packages/Xamarin.AndroidX.AppCompat.Resources
Use Xamarin.AndroidX.AppCompat.AppCompatResources
instead
https://www.nuget.org/packages/Xamarin.AndroidX.AppCompat.AppCompatResources
I see the reason for confusion. There was automatic update that is not obsoleted.
Formatted xml snippet:
<ItemGroup>
<PackageReference Include="MediatR">
<Version>12.1.1</Version>
</PackageReference>
<PackageReference Include="PhotoBrowser.Forms">
<Version>0.1.4</Version>
</PackageReference>
<PackageReference Include="Plugin.Toast">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Sharpnado.Forms.HorizontalListView">
<Version>1.8.2</Version>
</PackageReference>
<PackageReference Include="Sharpnado.Presentation.Forms">
<Version>1.7.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Activity">
<Version>1.7.2.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat.Resources">
<Version>1.1.0.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Browser">
<Version>1.4.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Fragment">
<Version>1.6.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4">
<Version>1.0.0.19</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials">
<Version>1.7.7</Version>
</PackageReference>
<PackageReference Include="Xamarin.Google.Android.Material">
<Version>1.5.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Core.UI">
<Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Fragment">
<Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Rg.Plugins.Popup">
<Version>2.1.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Base">
<Version>118.2.0.1</Version>
</PackageReference>
<PackageReference Include="RestSharp">
<Version>110.2.1-alpha.0.10</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.Messaging">
<Version>123.1.2.2</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat">
<Version>1.6.1.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat">
<Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources">
<Version>1.6.1.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2515</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Core">
<Version>1.9.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.CustomView">
<Version>1.1.0.18</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Preference">
<Version>1.2.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.RecyclerView">
<Version>1.3.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Navigation.UI">
<Version>2.3.5.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Ads">
<Version>121.2.0</Version>
</PackageReference>
</ItemGroup>
@alooosh
All I need is PackageReferences:
<ItemGroup> <PackageReference Include="MediatR"> <Version>12.1.1</Version> </PackageReference> <PackageReference Include="PhotoBrowser.Forms"> <Version>0.1.4</Version> </PackageReference> <PackageReference Include="Plugin.Toast"> <Version>2.2.0</Version> </PackageReference> <PackageReference Include="Sharpnado.Forms.HorizontalListView"> <Version>1.8.2</Version> </PackageReference> <PackageReference Include="Sharpnado.Presentation.Forms"> <Version>1.7.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Activity"> <Version>1.7.2.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources"> <Version>1.1.0.2</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Browser"> <Version>1.4.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Fragment"> <Version>1.6.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4"> <Version>1.0.0.19</Version> </PackageReference> <PackageReference Include="Xamarin.Essentials"> <Version>1.7.7</Version> </PackageReference> <PackageReference Include="Xamarin.Google.Android.Material"> <Version>1.5.0</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.Core.UI"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.Fragment"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Rg.Plugins.Popup"> <Version>2.1.0</Version> </PackageReference> <PackageReference Include="Xamarin.GooglePlayServices.Base"> <Version>118.2.0.1</Version> </PackageReference> <PackageReference Include="RestSharp"> <Version>110.2.1-alpha.0.10</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.Messaging"> <Version>123.1.2.2</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat"> <Version>1.6.1.3</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.v7.AppCompat"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources"> <Version>1.6.1.3</Version> </PackageReference> <PackageReference Include="Xamarin.Forms"> <Version>5.0.0.2515</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Core"> <Version>1.9.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.CustomView"> <Version>1.1.0.18</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Preference"> <Version>1.2.0</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.RecyclerView"> <Version>1.3.0</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Navigation.UI"> <Version>2.3.5.5</Version> </PackageReference> <PackageReference Include="Xamarin.GooglePlayServices.Ads"> <Version>121.2.0</Version> </PackageReference> </ItemGroup> <ItemGroup>
from brief look at it you have 2 huge potential problems:
- using Android.Support
- using
Xamarin.AndroidX.AppCompat.Resources
which is deprecated https://www.nuget.org/packages/Xamarin.AndroidX.AppCompat.Resources UseXamarin.AndroidX.AppCompat.AppCompatResources
instead https://www.nuget.org/packages/Xamarin.AndroidX.AppCompat.AppCompatResources I see the reason for confusion. There was automatic update that is not obsoleted. Formatted xml snippet:<ItemGroup> <PackageReference Include="MediatR"> <Version>12.1.1</Version> </PackageReference> <PackageReference Include="PhotoBrowser.Forms"> <Version>0.1.4</Version> </PackageReference> <PackageReference Include="Plugin.Toast"> <Version>2.2.0</Version> </PackageReference> <PackageReference Include="Sharpnado.Forms.HorizontalListView"> <Version>1.8.2</Version> </PackageReference> <PackageReference Include="Sharpnado.Presentation.Forms"> <Version>1.7.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Activity"> <Version>1.7.2.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources"> <Version>1.1.0.2</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Browser"> <Version>1.4.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Fragment"> <Version>1.6.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4"> <Version>1.0.0.19</Version> </PackageReference> <PackageReference Include="Xamarin.Essentials"> <Version>1.7.7</Version> </PackageReference> <PackageReference Include="Xamarin.Google.Android.Material"> <Version>1.5.0</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.Core.UI"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.Fragment"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Rg.Plugins.Popup"> <Version>2.1.0</Version> </PackageReference> <PackageReference Include="Xamarin.GooglePlayServices.Base"> <Version>118.2.0.1</Version> </PackageReference> <PackageReference Include="RestSharp"> <Version>110.2.1-alpha.0.10</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.Messaging"> <Version>123.1.2.2</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat"> <Version>1.6.1.3</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.v7.AppCompat"> <Version>28.0.0.3</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources"> <Version>1.6.1.3</Version> </PackageReference> <PackageReference Include="Xamarin.Forms"> <Version>5.0.0.2515</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Core"> <Version>1.9.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.CustomView"> <Version>1.1.0.18</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Preference"> <Version>1.2.0</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.RecyclerView"> <Version>1.3.0</Version> </PackageReference> <PackageReference Include="Xamarin.AndroidX.Navigation.UI"> <Version>2.3.5.5</Version> </PackageReference> <PackageReference Include="Xamarin.GooglePlayServices.Ads"> <Version>121.2.0</Version> </PackageReference> </ItemGroup>
Yes thank you after I updated all the packages I can build the android but I lost the Keystore
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
VS2022 17.6 MAUI .Net7.0
Description
I try to integrate the Evergine engine as a custom view on MAUI, Windows, Mac and iOS works but the Android profile throws the following error "AndroidX.Lifecycle.ClassesInfoCache$MethodReference is defined multiples times",
Steps to Reproduce
Download and compile the following project https://github.com/Jorgemagic/EvergineIntegration/tree/feature/Android
Did you find any workaround?
No response
Relevant log output