Migrating to AndroidX

AndroidX replaces the original support library APIs with packages in the androidx namespace. Only the package and Maven artifact names changed; class, method, and field names did not change.

Prerequisites

Before you migrate, bring your app up to date. We recommend updating your project to use the final version of the support library: version 28.0.0. This is because AndroidX artifacts with version 1.0.0 are binary equivalent to the Support Library 28.0.0 artifacts.

Migrate an existing project using Android Studio

With Android Studio 3.2 and higher, you can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

The refactor command makes use of two flags. By default, both of them are set to true in your gradle.properties file:

android.useAndroidX=true
The Android plugin uses the appropriate AndroidX library instead of a Support Library.
android.enableJetifier=true
The Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries.

Mappings

If you run into issues with migration, refer to these tables to determine the proper mappings from the support library to the corresponding AndroidX artifacts and classes:

For the latest versions of the Jetpack libraries, see the versions page.

Additional resources

To learn more about migrating your code to AndroidX, see the following additional resources:

Blog posts