Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in threads .. zip END header not found #73852

Closed
mahimakaushik-oss opened this issue Jan 13, 2021 · 16 comments
Closed

Exception in threads .. zip END header not found #73852

mahimakaushik-oss opened this issue Jan 13, 2021 · 16 comments
Labels
in triage Presently being triaged by the triage team

Comments

@mahimakaushik-oss
Copy link

mahimakaushik-oss commented Jan 13, 2021

Hello , Mahima here. I am getting error while running my flutter application on simulator..
flutter doctor showing everything fine.
application is running on chrome web but this error is coming while running on simulator.
anyone know this so please help me to remove this error.

Running Gradle task 'assembleDebug'...
Exception in thread "main" java.util.zip.ZipException: zip END header not found
	at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1567)
	at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1462)
	at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1469)
	at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1274)
	at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237)
	at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:727)
	at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:247)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:177)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:191)
	at org.gradle.wrapper.Install.unzip(Install.java:214)
	at org.gradle.wrapper.Install.access$600(Install.java:27)
	at org.gradle.wrapper.Install$1.call(Install.java:74)
	at org.gradle.wrapper.Install$1.call(Install.java:48)
	at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
	at org.gradle.wrapper.Install.createDist(Install.java:48)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Exception: Gradle task assembleDebug failed with exit code 1

THANKS

@TahaTesser
Copy link
Member

TahaTesser commented Jan 13, 2021

Hi @mahimakaushik-oss
The error is related to Gradle, this is usually due to a corrupt or incomplete Gradle setup
Go to the user root directory and locate the hidden .gradle folder and delete it.
If you're on a mac, open the terminal and execute

cd ~
rm -rf .gradle

and then run your app connected to an Android emulator or device, don't cancel, and make sure to have a stable internet connection, this will download fresh Gradle

If the problem persists, Can you please provide your flutter doctor -v and flutter run --verbose logs, and a minimal complete reproducible code sample?
Thank you

@TahaTesser TahaTesser added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Jan 13, 2021
@mahimakaushik-oss
Copy link
Author

Hi @mahimakaushik-oss
The error is related to Gradle, this is usually due to corrupt or incomplete Gradle setup
Go to the root directory and locate the hidden .gradle folder and delete it.
If you're on a mac, open terminal and execute

cd ~
rm -rf .gradle

and then run your app connected to Android emulator or device, don't cancel and make have a stable internet connection, this will download fresh Gradle

If the problem persists, Can you please provide your flutter doctor -v and flutter run --verbose logs, and a minimal complete reproducible code sample?
Thank you

I am having window. so what is the command for windows cmd?

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 14, 2021
@TahaTesser
Copy link
Member

TahaTesser commented Jan 14, 2021

Hi @mahimakaushik-oss
if you're using Windows, Go to the root directory C:\Users\YourUser and locate the hidden .gradle folder and delete it.
and then run your app connected to an Android emulator or device, don't cancel and make have a stable internet connection, this will download fresh Gradle

If the problem persists, Can you please provide your flutter doctor -v and flutter run --verbose logs, and a minimal complete reproducible code sample?
Thank you

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 14, 2021
@mahimakaushik-oss
Copy link
Author

problem solved...
------------------my emulator SDK tool was not updated. hence causing that issue..
THANK YOU @TahaTesser

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 15, 2021
@TahaTesser
Copy link
Member

Hi @mahimakaushik-oss
Glad you resolved the issue, given your last message I feel safe to close this issue if you disagree please write in the comments and I will reopen it.
Thank you

@bernandez
Copy link

Please I am facing the same problem

@bksubhuti
Copy link

I had the same problem and this fixed it.
Probable causes:

  • I remember early on stopping the build because it took a long time.
  • I also remember getting an error in the beginning about licensing.
  • I have built an android app too.

Not sure which one broke it, but now it is good.

@muhammadabdumalikov
Copy link

flutter
Hi, I've this problem too
Can you help?

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.1, on Linux, locale en_US.UTF-8)
• Flutter version 2.2.1 at /home/muhammad/snap/flutter/common/flutter
• Framework revision 02c026b (6 weeks ago), 2021-05-27 12:24:44 -0700
• Engine revision 0fdb562ac8
• Dart version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /home/muhammad/Android/Sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /snap/android-studio/113/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8 0-b944-P17168821)
• All Android licenses accepted.

[✓] Chrome - develop for the web
• Chrome at google-chrome

[✓] Android Studio (version 4.2)
• Android Studio at /snap/android-studio/113/android-studio
• Flutter plugin version 58.0.1
• Dart plugin version 202.8531
• Java version OpenJDK Runtime Environment (build 11.0.8 0-b944-P17168821)

[✓] Connected device (2 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114

• No issues found!
muhammad@muhammad-TM1703:~$ flutter run --verbose
[ 62 ms] executing: uname -m
[ 28 ms] Exit code 0 from: uname -m
[ ] x86_64
[ 6 ms] executing: [/home/muhammad/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ 4 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 02c026b
[ ] executing: [/home/muhammad/snap/flutter/common/flutter/] git tag --points-at 02c026b
[ 12 ms] Exit code 0 from: git tag --points-at 02c026b
[ ] 2.2.1
[ 7 ms] executing: [/home/muhammad/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ 5 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [/home/muhammad/snap/flutter/common/flutter/] git ls-remote --get-url origin
[ 4 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ 78 ms] executing: [/home/muhammad/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD
[ 4 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ 57 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ 3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ 63 ms] executing: /home/muhammad/Android/Sdk/platform-tools/adb devices -l
[ 37 ms] List of devices attached
emulator-5554 device product:sdk_gphone_x86_arm model:AOSP_on_IA_Emulator device:generic_x86_arm transport_id:3
[ 5 ms] /home/muhammad/Android/Sdk/platform-tools/adb -s emulator-5554 shell getprop
[ 30 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ 2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ 1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ 28 ms] "flutter run" took 193ms.
[ 16 ms] Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
[ 2 ms]
#0 FlutterCommand.validateCommand (package:flutter_tools/src/runner/flutter_command.dart:1309:11)
#1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:448:19)
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1148:11)

#3 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1043:27)

#4 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)

#5 CommandRunner.runCommand (package:args/command_runner.dart:196:13)

#6 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)

#7 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)

#8 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)

#9 run.. (package:flutter_tools/runner.dart:62:9)

#10 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)

#11 main (package:flutter_tools/executable.dart:91:3)

[ 255 ms] ensureAnalyticsSent: 253ms
[ 1 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1
muhammad@muhammad-TM1703:~$

@bksubhuti
Copy link

I don't know.. i just deleted the .gradle folder and recompiled and it worked.

@muhammadabdumalikov
Copy link

I don't know.. i just deleted the .gradle folder and recompiled and it worked.

Thank, worked

@yasin459
Copy link

hi @TahaTesser
i am having this issue but I can't find any .gradle folder in this project which I'm currently working on,
it might be a newbie mistake but how can I create this .gradle folder?

@bksubhuti
Copy link

Files with a dot in front are hidden. Mine was in my home directory. Ctrl H will display hidden files in Linux.

If you installed with snap. I don't know.

@yasin459
Copy link

Files with a dot in front are hidden. Mine was in my home directory. Ctrl H will display hidden files in Linux.

If you installed with snap. I don't know.

I know it's hidden and I checked the checkbox to show hidden files but it's not there, in fact, I'm asking if how can I create this .gradle folder?

@bksubhuti
Copy link

I don't know.. maybe you should reinstall android studio and flutter again.

@EdungDivinefavour
Copy link

Just open the android folder in android studio it will tell you your gradle is corrupted and you will see a button that says "Delete and sync again". When you do. Voila error gone!

@bksubhuti no need to reinstall android studio and flutter

@github-actions
Copy link

github-actions bot commented Aug 6, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in triage Presently being triaged by the triage team
Projects
None yet
Development

No branches or pull requests

7 participants