AndroidX NuGet Packages are Stable!

Avatar

Jon

Last year, we introduced AndroidX for Xamarin. In addition to that, today we are happy to bring you stable AndroidX NuGet packages!

Furthermore, since AndroidX is a big transition for your Android projects, we have also introduced a number of ways to migrate your Xamarin Android projects.

AndroidX NuGet Migration Tooling

There are three migration steps to be aware of regarding your application.

  1. Your application includes Android Support Library namespaces in need of migration to AndroidX namespaces. Use the Migrate to AndroidX IDE tooling to handle most namespace scenarios.

First, enable the AndroidX Migrator inside Visual Studio 2019 Preview 16.5+ via: Tools > Options > Xamarin > Android Settings. (You can skip this step on Visual Studio for Mac 8.5+)

Image AndroidXMigrator AndroidX NuGet Packages

Next, right-click your project and Migrate to AndroidX.

Image MigrateToAndroidX AndroidX NuGet Packages

Note: You will need to make some manual namespace changes for a few scenarios our tool doesn’t cover. While we will map the correct package for you, we encourage you to review the official artifact mappings. As well as the class mappings to help with your project migration.

  1. Your application includes any dependencies that have not been migrated to the AndroidX namespace. Use the Android Support Library to AndroidX Migration package.
  2. Your application does not include any dependencies that require AndroidX namespace migration. Use the AndroidX libraries available on NuGet today.

How This May Affect You

The majority of packages you know and love have already migrated to AndroidX on Android 10 and above. Starting with Xamarin.Forms 4.5, AndroidX will replace the Android Support Libraries. Additionally, once this is supported in Xamarin.Forms, we will migrate Xamarin.Essentials to AndroidX.

As everything slowly migrates to AndroidX in favor of the Support Libraries, we will make our “out-of-box” IDE experience the default to using AndroidX and Android 10.

Try the AndroidX NuGet Packages Today

We are continuously improving this experience and want to know your thoughts! For any issues with AndroidX or Xamarin, please file an issue on Developer Community. You may also file an issue within the Xamarin AndroidX GitHub repository.

Additionally, share any suggestions for how we can improve the AndroidX experience by filing a suggestion on Developer Community.

Lastly, check out our Xamarin AndroidX Migration GitHub repository for some tips and tricks in using the package, known issues, and limitations!

3 comments

Comments are closed.

  • Avatar
    Charles Roddie

    This may be a necessary update, but the problem for users seems to remain. So many packages in Xamarin projects with no guidance about which packages should be installed. https://www.nuget.org/packages?q=androidx gives 122 packages. Should all of these be installed? None of them? A subset?

    What should happen: if Xamarin.Forms depends on packages it should get those automatically as transitive dependencies. Xamarin users shouldn’t need to install any of these for a default experience and they shouldn’t appear in Nuget Package Manager.

  • Avatar
    Dávid Almási

    Hi, I guess it does not make too much sense to try, but still: When can we expect a production-grade release? By starting a new Xamarin Android project, it still comes with the old android support library dependencies. When will be AndroidX integrated into Visual Studio?