Flutter升级之后项目不能运行

flutter运行之后报了这个错,不能够运行。

The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.

在结果上面会提示appt2等错误,其实错误的原因是Androidx支持有问题。
官方解决办法:https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility(合理打开)

app/build.gradle 下面

compileSdkVersion 28 //要大于28

在gradle.properties下添加:

android.useAndroidX=true
android.enableJetifier=true

重新清理运行,ok。

你可能感兴趣的:(Flutter升级之后项目不能运行)