Matrimony App - Android X Migration

image

In line with our philosophy of keeping our products upto date on the tech changes that get introduced, we moved to Android’s next big release AndroidX. This ia precursor to JetPack.

Google is also moving all support components to X.
For example, android.support.v7.app.AppCompatActivity is now
androidx.appcompat.app.AppCompatActivity.
This change might take you some extra effort.

Steps to complete the Migration of Android X

Steps Step to Complete the Android X Migration
1 Migrate the App into 28 Compile
2 Migrate the Gradle Wrapper - 4.6
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
3 Migrate the Gradle Tool - 3.2
com.android.tools.build:gradle:3.2.0
4 If you have any class name that starts with a capital letter, follow the below steps to resolve the issue

Refactor the Folder name -> viewmodel instead of ViewModel -> Because In Android Plugin 3.2.0 and above, the databinding V2 is enabled by default. We guess the databinding V2 compiler treats any component that starts with an Uppercase letter as a class, not a package

Reference URL :
https://stackoverflow.com/questions/52495124/gradle-plugin-3-2-0-with-databinding-can-not-resolve-package-name
5 Refactor to Andorid X -> Refactor -> Migrate to Android X
After Upgrading the following points automatically replaced in in gradle.properties
android.enableJetifier=true
android.useAndroidX=true
6 If you are using Glide in your app, follow the below steps.
Glide compiler 4.8.0 supports androidx.annotation namespace. This is important.
Replace the annotation for Gradle
From
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'

To implementation('com.github.bumptech.glide:glide:4.8.0') {
transitive = true;
}
annotationProcessor 'androidx.annotation:annotation:1.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'

Reference URL : https://github.com/bumptech/glide/issues/3185;
https://github.com/bumptech/glide/issues/3080
7 Support Library Setup

With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.

You can continue to use the support library. Historical 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.

Once migration is done, you can easily adopt the JETPACK components in your product.