Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate flutter project to androidx

How to migrate existing flutter project to Android X ? Are there any pro and cons?

like image 942
Asfos22 Avatar asked Mar 03 '19 09:03

Asfos22


People also ask

How to migrate from Android Studio to flutter?

Now go to you app level build.gradle file and change your compileSdkVersion and targetSdkVersion to 28. Now right click on android directory in your flutter project go to Flutter and click on Open Android module in Android Studio and then click on new window. If you want backup select the check box and click Migrate.

How do I migrate a project from Android Studio to androidx?

Migrate an existing project using Android Studio. With Android Studio 3.2 and higher, you can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar. The refactor command makes use of two flags. By default, both of them are set to true in your gradle.properties file:

How to migrate Android refactor to androidx?

Select Migrate to AndroidX from the Refactor menu. If you are asked to backup the project before proceeding, check Backup project as Zip file, then click Migrate . Lastly, save the zip file in your location of preference. The refactoring preview shows the list of changes. Finally, click Do Refactor : That is it!

Do I need to migrate my Android app to Android X?

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.0as the change log says, it required a migration to Android X. Your Android app is in the androiddirectory of the project.


2 Answers

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
like image 199
Shababb Karim Avatar answered Oct 17 '22 16:10

Shababb Karim


In your IDE menu, go to Refactor and use Migrate to AndroidX...

enter image description here

like image 5
CopsOnRoad Avatar answered Oct 17 '22 18:10

CopsOnRoad