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

andre eis 1 Reputation point
2022-05-24T14:31:02.707+00:00

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?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,293 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,291 Reputation points Microsoft Vendor
    2022-05-25T01:44:42.28+00:00

    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.

    0 comments No comments