Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to migrate Flutter project to AndroidX

I have a Flutter project in Android Studio. I am planning to migrate to AndroidX. Whenever I do Refactor -> Migrate to AndroidX, Android Studio shows error message:

You need to have compileSdk set to at least 28 in your module build.gradle to migrate to AndroidX.

However I have already set the compileSdkVersion 28 in my app/gradle.build file.

enter image description here

Is there anything else I need to do?

like image 741
Sam Avatar asked Jan 28 '19 04:01

Sam


People also ask

How do I migrate to AndroidX library?

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.

How to migrate a Flutter App from Android Studio to androidx?

=> First of all instead of refactoring the flutter app project from the menu of Android Studio, just open the app project's android folder with Android Studio and then do the refactoring for the migration to AndroidX. Just follow the instructions from the Android Studio and the migration can be done!!

What is androidx in flutter?

Flutter Basic Tutorials AndroidX also known as Android Extension Library is a new way to manage packages bundles in android development sector. Using AndroidX we can individually manage which packages are bundled with Android operating system and which are bundled with android APK file using new modified file structure.

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 install Google Play Services on Android using flutter?

Right click on the android directory, click on Flutter -> Open Android module in Android Studio. It asked me to upgrade my gradle plugin. Then I installed Google Play Services. Tools -> SDK Manager -> SDK Tools and check the Google Play Services.


Video Answer


1 Answers

I was able to resolve my issue:

  1. Open the Flutter project into Android Studio
  2. Right click on the android directory, click on Flutter -> Open Android module in Android Studio. It asked me to upgrade my gradle plugin.
  3. Then I installed Google Play Services. Tools -> SDK Manager -> SDK Tools and check the Google Play Services.

After the Google Play Services Installed, I did Refactor -> Migrate to AndroidX. It started working.

Note: Do the refactor from the project window you opened in the step 2.

like image 63
Sam Avatar answered Oct 04 '22 11:10

Sam