Migrate to AndroidX

Migrate to AndroidX
AndroidX

I. How to migrate an existing project to AndroidX

In Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor -> Migrate to AndroidX from the menu bar.
complile SDK version and target SDK version must be 28 

II. AndroidX in a new project

If you want to use AndroidX in a new project, you need to set the compile SDK to Android 9.0 (API level 28) or higher and The following Android Gradle plugin flags to true in your gradle.properties file.

set android.useAndroidX=true , the Android plugin uses the appropriate AndroidX library instead of a Support Library. android.useAndroidX  is false by default if it is not specified.

set android.enableJetifier=true , the Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries. android.useAndroidX is false by default if it is not specified.