question

andreeis-3365 avatar image
0 Votes"
andreeis-3365 asked YonglunLiu-MSFT commented

Xamarin.AndroidX.legacy.Support.V13 not being installed on my app!!!

My first error was that I could not upload the latest copy of my app to google store as they now require API 30 and I was using 29
I changed target framework to 12 and target version to 12 (API 31)
I then got some errors about wanting a different sdk which I installed
This was followed by some packages wanting a nuGet update - unfortunately I just clicked all followed by update without taking a note of what it wanted

Then I got the following

Error Could not find 3 Android X assemblies, make sure to install the following NuGet packages:
- Xamarin.AndroidX.Legacy.Support.V13
- Xamarin.AndroidX.MediaRouter
- Xamarin.AndroidX.Palette
You can also copy-and-paste the following snippet into your .csproj file:
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V13" Version="1.0.0.5" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0" />
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.5" />

If I add these to the the .Android.csproj the error doesn't go away.
If instead I add them to the normal .csproj the above error goes away but I get this new one

Package Xamarin.AndroidX.Palette 1.0.0.5 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.AndroidX.Palette 1.0.0.5 supports: monoandroid90 (MonoAndroid,Version=v9.0)Severity Code Description Project File Line Suppression State
Package Xamarin.AndroidX.MediaRouter 1.2.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.AndroidX.MediaRouter 1.2.0 supports: monoandroid90 (MonoAndroid,Version=v9.0)
Package Xamarin.AndroidX.Legacy.Support.V13 1.0.0.5 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.AndroidX.Legacy.Support.V13 1.0.0.5 supports: monoandroid90 (MonoAndroid,Version=v9.0)

However 3 nuGet updates appear
Doing update all gives

Package restore failed. Rolling back package changes
Package Xamarin.AndroidX.Palette 1.0.0.13 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.AndroidX.Palette 1.0.0.13 supports:
- monoandroid12.0 (MonoAndroid,Version=v12.0)
- net6.0-android31.0 (.NETCoreApp,Version=v6.0)
Package Xamarin.AndroidX.MediaRouter 1.3.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.AndroidX.MediaRouter 1.3.0 supports:
- monoandroid12.0 (MonoAndroid,Version=v12.0)
- net6.0-android31.0 (.NETCoreApp,Version=v6.0)
Package Xamarin.AndroidX.Legacy.Support.V13 1.0.0.13 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.AndroidX.Legacy.Support.V13 1.0.0.13 supports:
- monoandroid12.0 (MonoAndroid,Version=v12.0)
- net6.0-android31.0 (.NETCoreApp,Version=v6.0)

cmd
dotnet --version
6.0.300

Why can I not update these 3 packages?
Why do I suddenly need them when I have not needed them for the last 3 years?

dotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


I have not heard from you for a couple of days. Please let me know if there is anything that I can help here.

0 Votes 0 ·

1 Answer

YonglunLiu-MSFT avatar image
0 Votes"
YonglunLiu-MSFT answered

Hello,

Please make sure that you are installing NuGet packages into the Android project in Xamarin.

In addition, I found that you used MonoAndroid,Version=v9.0. Referring to this Announcement Updated AndroidX packages require MonoAndroid12.0+, If you want to use AndroidX package, you need to add MonoAndroid12.0+ reference into your project.

Best Regards,

Alec Liu.



If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.