flutter - Gradle 同步失败:原因:断言 pluginDirectory.exists()
问题描述
我在标题和下面有错误。当您在文件夹 /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
解决方案
assert pluginDirectory.exists()
pub cache
由于您以某种方式不同步,因此正在返回错误。
在这种情况下,使用命令
flutter pub get
从您的根文件夹中,以便将所有依赖项与缓存重新同步。
推荐阅读
- flutter - Flutter showMenu() x 轴位置
- javascript - 在单个部分上垂直滚动
- css - 什么是 CSS 选择器的级别?3级和4级有区别吗?
- azure-sql-database - 通过托管标识通过 Azure SQL 数据库访问 Azure Blob 存储
- python - 我想分隔最后一位数字相同的数字
- java - 使用不同方式从二维数组获取值时的不同输出
- android - 三星 Bixby Key 的密钥常数是多少?
- django - django 阻止模型根据条件更新
- spring-boot - Apache骆驼xml反序列化失败
- python - cs50 可读性 pset6 python - 索引计算问题