【发布时间】:2021-05-19 05:45:08
【问题描述】:
我在标题及下方出现了错误。当您在文件夹 /android 上打开 Android Studio 时会发生错误。我的项目是一个 Flutter 项目。我在三星 Galaxy A10 上使用 Android 应用 Max 2D Game 创建了我的项目。
Gradle sync failed: Cause: assert pluginDirectory.exists()
| |
| false >
\root\snap\flutter\common\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.15.1\android
我邀请您在Gitpod 上探索我的项目或在GitHub 上分叉并提交修复此错误的拉取请求。
在 android/app 文件夹中打开 android studio 我得到以下错误:
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Administrator\Downloads\flutter_windows_2.2.0-stable\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle' line: 27
* What went wrong:
A problem occurred evaluating script.
> assert pluginDirectory.exists()
| |
| false
\root\snap\flutter\common\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.15.1\android
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 121ms
【问题讨论】:
-
似乎 pub 缓存不包含该特定插件。尝试再次运行
flutter pub get,然后重建应用程序 -
这为我解决了
-
哦,太好了,我们应该发布答案以帮助他人。你想让我这样做吗?
-
是的,你可以做到,我评论的正是在考虑帮助其他人。