xamarin / AndroidX

AndroidX bindings for .NET for Android
MIT License
185 stars 46 forks source link

Type AndroidX.Lifecycle.ClassesInfoCache$MethodReference is defined multiples times #749

Closed Jorgemagic closed 1 year ago

Jorgemagic commented 1 year ago

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

Severity    Code    Description Project File    Line    Suppression State
Error   JAVA0000    Error in C:\Users\jferrero\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class:
Type androidx.lifecycle.DispatchQueue is defined multiple times: C:\Users\jferrero\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class, obj\Debug\net7.0-android\lp\136\jl\classes.jar:androidx/lifecycle/DispatchQueue.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\jferrero\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.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: C:\Users\jferrero\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.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: C:\Users\jferrero\.nuget\packages\xamarin.androidx.lifecycle.common\2.6.1.2\buildTransitive\net6.0-android31.0\..\..\jar\androidx.lifecycle.lifecycle-common.jar:androidx/lifecycle/DispatchQueue.class, obj\Debug\net7.0-android\lp\136\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\Debug\net7.0-android\lp\136' is from 'androidx.lifecycle.lifecycle-runtime-ktx.aar'. EvergineIntegration.Maui        1
moljac commented 1 year ago

update your Android dependencies (AndrodiX and GooglePlayServices-Firebase-MLKit) to the latest, please.

trussellswitch commented 1 year ago

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.

moljac commented 1 year ago

@trussellswitch

Thanks for the feedback. Can you post your PackageReference[s]?

moljac commented 1 year ago

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.

moljac commented 1 year ago

Duplicates:

https://github.com/xamarin/AndroidX/issues/717 https://github.com/xamarin/AndroidX/issues/742 https://github.com/xamarin/AndroidX/issues/747 https://github.com/xamarin/AndroidX/issues/749

alooosh commented 1 year ago

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)

moljac commented 1 year ago

@alooosh

Thanks for the feedback, but I'll need more info. Can you show me your PackageReferences, please?

alooosh commented 1 year ago

yes sure

image
alooosh commented 1 year ago

@alooosh

Thanks for the feedback, but I'll need more info. Can you show me your PackageReferences, please?

image
moljac commented 1 year ago

@alooosh please open your project file *.csproj and paste text here.

... and update your packages afterwards

alooosh commented 1 year ago

@alooosh please open your project file *.csproj and paste text here.

... and update your packages afterwards

`<?xml version="1.0" encoding="utf-8"?>

Debug AnyCPU {42E40C30-E740-4E6A-A420-52A9212B9EBE} {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} {6968b3a4-1835-46a3-ac5c-1ae33b475983} Library shobiklobik.Droid shobiklobik.Android True True Resources\Resource.designer.cs Resource Properties\AndroidManifest.xml Resources Assets v12.0 true true Xamarin.Android.Net.AndroidClientHandler true true portable false bin\Debug DEBUG; prompt 4 None false false true false true r8 true true true true true dx armeabi-v7a;arm64-v8a;x86 7.3 true portable false bin\Release DEBUG; prompt 4 true false false false false false 7.3 None true true r8 true 12.1.1 0.1.4 2.2.0 1.8.2 1.7.1 1.7.2.1 1.1.0.2 1.4.0.1 1.6.0.1 1.0.0.19 1.7.7 1.5.0 28.0.0.3 28.0.0.3 2.1.0 118.2.0.1 110.2.1-alpha.0.10 123.1.2.2 1.6.1.3 28.0.0.3 1.6.1.3 5.0.0.2515 1.9.0.1 1.1.0.18 1.2.0 1.3.0 2.3.5.5 121.2.0 {04549FF9-330B-4BFA-9795-4DA2E2C15069} shobiklobik Designer `
trussellswitch commented 1 year ago

@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.

moljac commented 1 year ago

Updating to latest versions in the ExoPlayer bindings resolved the issue.

@trussellswitch Thanks for the feedback.

moljac commented 1 year ago

@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:

<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 commented 1 year ago

@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:

<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