在编译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,后面添加
android.useAndroidX=true
android.enableJetifier=true
3、修改/项目目录/android/app/src/build.gradle,将
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
修改成
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'