运行Flutter项目时Your app isn't using

2020-04-15  本文已影响0人  天色将变
报了如下错误:

Launching lib/main.dart on sdk gphone x86 in debug mode...
[!] Your app isn't using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY.
Running Gradle task 'assembleDebug'...
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。

FAILURE: Build failed with an exception.

Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not download x86_debug.jar (io.flutter:x86_debug:1.0.0-5aff3119480996ca014ec0f8d26d74db617b5852)
Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-5aff3119480996ca014ec0f8d26d74db617b5852/x86_debug-1.0.0-5aff3119480996ca014ec0f8d26d74db617b5852.jar'.
Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-5aff3119480996ca014ec0f8d26d74db617b5852/x86_debug-1.0.0-5aff3119480996ca014ec0f8d26d74db617b5852.jar'.
Read timed out

BUILD FAILED in 3m 37s
Exception: Gradle task assembleDebug failed with exit code 1

原因

字面意思:你的app没有使用AndroidX
那就让app使用AndroidX,在gradle.properties中添加:

android.enableJetifier=true
android.useAndroidX=true
image.png
上一篇下一篇

猜你喜欢

热点阅读