Android 上的 Flutter 错误:找不到 aapt2-proto.jar
Flutter Error on Android: Could not find aapt2-proto.jar
我的 Flutter 项目今天构建失败,出现以下错误:
Where: Build file 'D:\Dev\Flutter\Projects\Misc\flutter_app\android\app\build.gradle'
line: 26
What went wrong: A problem occurred evaluating project ':app'.
Could not resolve all artifacts for configuration 'classpath'.
Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
我也在AndroidStudio中启动了一个全新的Flutter项目,没有做任何更改,也得到了同样的错误。
我是 运行 Android Studio 3.2.1(10 月 9 日)构建于 Windows 10 64 位。
这是我的 Flutter 医生输出:
> D:\Dev\Flutter\Flutter\bin\flutter.bat --no-color doctor Doctor
> summary (to see all details, run flutter doctor -v): [√] Flutter
> (Channel master, v0.10.2-pre.30, on Microsoft Windows [Version
> 10.0.17134.345], locale en-AU) [√] Android toolchain - develop for Android devices (Android SDK 28.0.3) [√] Android Studio
> X Flutter plugin not installed; this adds Flutter specific functionality.
> X Dart plugin not installed; this adds Dart specific functionality. [√] Connected device (1 available)
>
> • No issues found! Process finished with exit code 0
(忽略 Flutter 和 Dart 插件未安装的警告,虽然一切正常,但它们总是在我身边)
我尝试了其他 ,例如确保 google() 存储库位于 Gradle 构建文件之上,但没有成功。
文件中缺少 google():flutter/packages/flutter_tools/gradle/flutter.gradle#L21
我的 Flutter 项目今天构建失败,出现以下错误:
Where: Build file 'D:\Dev\Flutter\Projects\Misc\flutter_app\android\app\build.gradle' line: 26
What went wrong: A problem occurred evaluating project ':app'.
Could not resolve all artifacts for configuration 'classpath'. Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
我也在AndroidStudio中启动了一个全新的Flutter项目,没有做任何更改,也得到了同样的错误。
我是 运行 Android Studio 3.2.1(10 月 9 日)构建于 Windows 10 64 位。
这是我的 Flutter 医生输出:
> D:\Dev\Flutter\Flutter\bin\flutter.bat --no-color doctor Doctor
> summary (to see all details, run flutter doctor -v): [√] Flutter
> (Channel master, v0.10.2-pre.30, on Microsoft Windows [Version
> 10.0.17134.345], locale en-AU) [√] Android toolchain - develop for Android devices (Android SDK 28.0.3) [√] Android Studio
> X Flutter plugin not installed; this adds Flutter specific functionality.
> X Dart plugin not installed; this adds Dart specific functionality. [√] Connected device (1 available)
>
> • No issues found! Process finished with exit code 0
(忽略 Flutter 和 Dart 插件未安装的警告,虽然一切正常,但它们总是在我身边)
我尝试了其他
文件中缺少 google():flutter/packages/flutter_tools/gradle/flutter.gradle#L21