1

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

programmer
  • 25
  • 1
  • 4
  • 11
  • I have found a couple of possible solution to this issue, can you give a try with [this community answer #1](https://stackoverflow.com/a/55642609/12857703) and [this community answer #2](https://stackoverflow.com/a/64223719/12857703)? – Ralemos Jan 27 '21 at 15:13

3 Answers3

0

Try this on build.gradle

minSdkVersion 16
compiledSdkVersion 28
targetSdkVersion 29
0

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

Syggnus
  • 1
  • 1
0

first go to your sdk path(eg:"C:\Users\aayus\AppData\Local\Android\sdk\platforms\android-29\android.jar.")

second you check android.jar file have in this folder. if this file was not here reinstall sdk in your android studio.

that's it,.