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.
Is there anything else I need to do?
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.
=> 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!!
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.
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:
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.
I was able to resolve my issue:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With