Flutter Projects & Android X Migration Issues

后端 未结 9 1263
粉色の甜心
粉色の甜心 2020-11-27 14:51

I just created a new flutter project, added a few plugins and I\'m getting the plugin switched to android x therefore i need to switch to android x. I\'ve tried all the diff

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 15:41

    Add this to the end of your pubspec.yaml file, without any parent:

    module:
      androidX: true
    

    Then, at android/graddle.properties add:

    android.useAndroidX=true
    android.enableJetifier=true
    

    Run at your CLI:

    flutter clean
    

    and rerun your code

    flutter run
    

    This may adjust your problem with AndroidX.

    For your SDK, i think you may change inside android/app/build.gradle

    minSdkVersion 21
    targetSdkVersion 28
    multiDexEnabled true
    

    the multiDexEnabled is optional (in case of some error related to it).

    I think this may solve your problem, please give me a feedback about it.

提交回复
热议问题