gradle 生成失败,出现异常-任务“:cloud_firestore:parseDebugLocalResources”执行失败

v09wglhw  于 2023-03-23  发布在  其他
关注(0)|答案(3)|浏览(158)

我在android studio代码上运行Flutter项目,当我运行代码时,我收到以下错误消息:

Launching lib\main.dart on sdk gphone x86 arm in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cloud_firestore:parseDebugLocalResources'.
> Could not resolve all files for configuration ':cloud_firestore:androidApis'.
   > Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-r
untime}.
      > Execution failed for PlatformAttrTransform: C:\Users\aayus\AppData\Local\Android\sdk\platforms\android-29\android.jar.
         > error in opening zip file

* 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 57s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        59.6s
Exception: Gradle task assembleDebug failed with exit code 1

这个错误已经来了好几天了,我还没有找到一个适当的解决方案,有人可以帮助这个?提前感谢

t3psigkw

t3psigkw1#

在build.gradle上试试这个

minSdkVersion 16
compiledSdkVersion 28
targetSdkVersion 29
baubqpgj

baubqpgj2#

我也遇到了同样的问题,但SDK API 31。
好吧,如果你进入错误信息目录。

"C:\Users\<yourUserName>\AppData\Local\Android\sdk\platforms\android-29\"

android-29
发生此错误是由于缺少“android”文件(可执行Jar文件)
你将只需要去android studio,删除SDK,给出错误,并重新安装
android-studio

v7pvogib

v7pvogib3#

首先转到您的sdk路径(例如:“C:\Users\aayus\AppData\Local\Android\sdk\platforms\android-29\android.jar”)。
第二你检查android.jar文件有在这个文件夹.如果这个文件不在这里重新安装sdk在你的android工作室.
就是这样。

相关问题