在编译APK的时候,很可能有如下提示:
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
1、Android studio编辑器,主菜单 - Refactor - Migrate to AndroidX,点Migrate按钮
2、修改/项目目录/android/gradle.properties,后面添加
1android.useAndroidX=true 2android.enableJetifier=true
3、修改/项目目录/android/app/src/build.gradle,将
1androidTestImplementation 'com.android.support.test:runner:1.0.2' 2androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
修改成
1androidTestImplementation 'androidx.test:runner:1.1.1' 2androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'