Google has recently introduced a new way of organizing support libraries called AndroidX.
Android Jetpack is a suite that provides tools, components and guidance to build Android Apps. Android jetpack provides various kinds of components such as Data Binding, Media & playback, Notifications, Permissions and many more. One of the important reason to use Jetpack is, it provides backword compatibility to Android API’s.
For more details about Android Jetpack visit here: Android Docs
AndroidX is also such kind of library provided by Android Jetpack. Basically it is An advanced version of Android Support libraries. Version 28.0.0 is the last release of the Support Library. There will be no more android. support library releases. All new feature development will be in the AndroidX namespace.
AndroidX is a major improvement to the original Android Support Library All packages in AndroidX live in a consistent namespace starting with the string AndroidX. The Support Library packages have been mapped into corresponding AndroidX. packages.
From August 1, 2019 , support for 64-bit architecture is made compulsory by Google Play due to performance improvements. But for each native 32-bit architecture you support/use you must include the corresponding 64-bit architecture. Hence, it became a confusing task for developers to manage different versions for each support library.
The AndroidX library contains the existing support library and also includes the latest Jetpack components. You can continue to use the support library. Old artifacts (those versioned 27 and earlier, and packaged as
android.support. will remain available on Google Maven. However, all new library development will occur in the AndroidX library.
Migrating your current Android Project to AndroidX is really simple. But before migration, you will have to check the following:
If your android studio version is 3.2.x you have to use gradle build version 3.2.1. If you are using android studio version 3.3.1 then your gradle build version should also be 3.3.1. If any mismatch happen in version means it will throw error.
Migration can be done in two ways:
You can simply add below two lines in your gradle.properties for migration.
For more details you can refer: