How to migrate existing flutter project to Android X ? Are there any pro and cons?
You would require to migrate to Android X if you intend to use features that have breaking changes for the latest library. I personally faced this problem cloud_firestore 0.9.0 as the change log says, it required a migration to Android X.
Your Android app is in the android
directory of the project. First open the android
directory with Android Studio 3.2+
. Then Refactor > Migrate to AndroidX. After that also add these to the gradle.properties
file in the android
directory
android.useAndroidX=true
android.enableJetifier=true
I did the same mentioned what has been mentioned by the last two answers. (Refactor -> Migrate to AndroidX ...) but it didn't help really. I still got the error by flutter that it's not a AndroidX project.
I fixed it by adding;
android.enableJetifier=true
android.useAndroidX=true
to android/gradle.properties
Note, there are one in root and the other in android-directory.
In your IDE menu, go to Refactor
and use Migrate to AndroidX...