Unable to migrate Flutter project to AndroidX

前端 未结 8 630
自闭症患者
自闭症患者 2020-12-14 15:24

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

相关标签:
8条回答
  • 2020-12-14 16:01

    A simple solution. follow the steps.

    1. Create a new app --> (tick androidX in the window) --> finish
    2. Add some lines in the android --> app --> build.gradle as follow, update the defaultConfig

      minSdkVersion 19
      targetSdkVersion 28
      multiDexEnabled true
      
    3. Go to Refractor --> migrateToAndroidx
    4. Do Flutter clean
    5. Restart
    6. Run

    hope it works now ...

    0 讨论(0)
  • 2020-12-14 16:10

    In gradle.build (app) add this

     compileSdkVersion 28
        defaultConfig {
            ......
            minSdkVersion 21
            targetSdkVersion 28
            ......
        }
    

    And there are some implementations required to use androidx :-

    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    

    And add these given two lines(below) to gradle.properties:-

    android.useAndroidX=true
    android.enableJetifier=true
    
    0 讨论(0)
提交回复
热议问题