How to fix flutter AndroidX incompatibility?

前端 未结 6 767
暗喜
暗喜 2021-01-02 17:36

I just import webview_flutter plugin and found that the plugin has incompatible with my flutter environment. Then using Android Studio I migrate my AndroidX environment with

相关标签:
6条回答
  • 2021-01-02 18:08

    Create a new flutter project and move existing code to it: flutter migration

    flutter create --androidx -t <project-type> <new-project-path>
    

    eg: flutter create --androidx -t app .

    0 讨论(0)
  • 2021-01-02 18:19

    In AndroidManifest file add permission under manifest tag

    0 讨论(0)
  • 2021-01-02 18:21

    Thanks for your suggestion,

    I've fixed it by doing these steps : 1. Try adding this line In your Project folder > android > app > build.gradle, add the following Line in

    multiDexEnabled true

    inside defaultConfig

    1. Then upgrade gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (previously on version 3.2.1)

    2. Run flutter clean and rebuild your project

    0 讨论(0)
  • 2021-01-02 18:23

    First make sure that all your packages in the pubspec.yaml are of the latest version. Then open the android project of your flutter app with android studio, select Refactor->Migrate to Androidx(make sure that you are doing that that from the android project and not from the flutter one). Wait until android studio finishes migrating your project, rebuild your project. Hope it helps!

    0 讨论(0)
  • 2021-01-02 18:24

    It seems like you are facing issues with dex and androidX.

    Follow https://stackoverflow.com/a/56490440/9236994

    this answer to resolve your issue.

    0 讨论(0)
  • you can solve this issue by following these step which is given in this link

    https://medium.com/@sahaishashank2507/the-gradle-failure-may-have-been-because-of-androidx-incompatibilities-in-this-flutter-app-39b34acee40e?source=---------2------------------

    You need to open your project in the android studio.
    select Refactor->Migrate to Androidx(You need to migrate Android Project not 
    flutter one)
    Android Studio finish some process you have to wait for it .
    Than rebuild your project and it will work fine.
    

    it can resolve your issue

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