How to migrate flutter project to androidx

后端 未结 3 1876
粉色の甜心
粉色の甜心 2020-12-18 06:05

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

相关标签:
3条回答
  • 2020-12-18 06:18

    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
    
    0 讨论(0)
  • 2020-12-18 06:23

    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.

    0 讨论(0)
  • 2020-12-18 06:37

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

    0 讨论(0)
提交回复
热议问题