Forum Xamarin.Forms

Upgrade project from Android 9 to Android 10

cDGo_IT_ConsultancycDGo_IT_Consultancy Member ✭✭
edited February 28 in Xamarin.Forms

Hi,

I'm trying to upgrade my project from Android 9 to Android 10 in Visual Studio 2019.
But when I'm trying to rebuild the solution, I get this error message:

Could not find 31 Android X assemblies, make sure to install the following NuGet packages:
- Xamarin.AndroidX.Lifecycle.LiveData
- Xamarin.Google.Android.Material
- Xamarin.AndroidX.Legacy.Support.V4
- Xamarin.AndroidX.MediaRouter
- Xamarin.AndroidX.Palette

So starting with installing Xamarin.AndroidX.Lifecycle.LiveData through NuGet

But than I get the error:
Package Xamarin.AndroidX.Lifecycle.LiveData 2.3.0.1 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.AndroidX.Lifecycle.LiveData 2.3.0.1 supports: monoandroid90 (MonoAndroid,Version=v9.0)

So I'm puzzeled, when I upgrade to Android 10 I get the error message to install packages which seem to be only for Android 9?
As a starter I surely must be making a mistake.
Can anyone point me in the right direction to get this upgrade done?

Best Answer

  • jezhjezh Member, Xamarin Team Xamurai
    Accepted Answer

    You can try to migrate your app to AndroidX.

    You can enable the AndroidX Migrator via Tools > Options > Xamarin > Android Settings inside Visual Studio 2019 (you can skip this step on Visual Studio for Mac).

    Right-click your project and Migrate to AndroidX.

    For more details, you can check document: AndroidX with Xamarin.


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

Answers

  • tareqelzoubitareqelzoubi Member ✭✭

    Hi @cDGo_IT_Consultancy please make sure to migrate your project to androidX and keep you android sdks up to date
    as you can see I'm using here android 11 with listed libraries you mentioned

  • jezhjezh Member, Xamarin Team Xamurai
    Accepted Answer

    You can try to migrate your app to AndroidX.

    You can enable the AndroidX Migrator via Tools > Options > Xamarin > Android Settings inside Visual Studio 2019 (you can skip this step on Visual Studio for Mac).

    Right-click your project and Migrate to AndroidX.

    For more details, you can check document: AndroidX with Xamarin.


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

  • @taregelzoubi You're video was very helpfull to check if everything else was done.
    @jezh your instruction was the actual step I needed to take

  • anteroantero Member ✭✭

    You should only install it in your Android project

Sign In or Register to comment.