Flutter构建版本AndroidX不兼容

时间:2019-08-21 15:01:47

标签: flutter

当我在模拟器或真实设备上运行项目时,它运行完美。 但是当我尝试使用

构建发行版时
flutter build apk --release

flutter build appbundle

它给了我这个错误

*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See URL for more information on the problem and how to fix it.
*******************************************************************************************
Gradle task assembleRelease failed with exit code 1

although I tried this

1 个答案:

答案 0 :(得分:0)

我遇到了类似的错误,并将以下行放入项目的/ android文件夹中的gradle.properties文件中。

android.enableJetifier=true
android.useAndroidX=true

但是根据评论部分,主要问题不是AndroidX警告,而是Gradle的关于库的assembleBuild任务中的问题。

看起来问题不是关于AndroidX。