AndroidX migration

How to migrate to AndroidX support library

AndroidX is the latest Android support library package and is an improved version of older support libraries. Android Studio seamlessly supports migration of Android code with support library to AndroidX.

To refactor the code and migrate to new AndroidX package follow the steps as given below.

Open Android Studio & open your project that you want to migrate.

Click on the Refactor and select Migrate to AndroidX

How to migrate android code to androidX

Click on Migrate which in turn will search for all references of older support library usages. The preview of the changes will be shown in the result window.

Refactor code to update and migrate to androidX

Click on Do Refactor 

Refactor code to migrate android support library to AndroidX

Android Studio will search and replace all the components and map to related AndroidX package.

This will also update app’s build.gradle file and replace support packages with AndroidX dependencies.

AndroidX build gradle dependecy


Leave a Reply