简体   繁体   中英

Build failed with an exception - Execution failed for task ':cloud_firestore:parseDebugLocalResources'

I was running a Flutter project on android studio code and when I run the code, I get this error message:

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

This error has been coming for a quite a few days now and I haven't found a proper solution Can someone help with this? Thanks in advance

Try this on build.gradle

minSdkVersion 16
compiledSdkVersion 28
targetSdkVersion 29

I had this same problem but with SDK API 31.

Well, if you enter the error message directory.

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

android-29

This error happens due to the absence of the "android" file (Executable Jar File)

You will just have to go to android studio, remove the SDK that is giving error and install again

android-studio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM