Flutter Gradle task assembleDebug failed with exit code 1 zip END header not found

· 178 words · 1 minute read

The error code is this.

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.(ZipFile.java:1274) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:727) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844) at java.base/java.util.zip.ZipFile.(ZipFile.java:247) at java.base/java.util.zip.ZipFile.(ZipFile.java:177) at java.base/java.util.zip.ZipFile.(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

This Problem came from gradle file is corrupted in your system. This fix works for any gradle version.

Open File Manager: enable Show hidden folder from top menu bar. Navigate to this location location : .gradle>wrapper>dists. Then delete everything inside dists directory/folder.

Location in Linux or Mac OS: Home > .gradle > wrapper > dists.

Location in Windows: C: > Users > {PC Name} > .gradle > wrapper > dists.

After deleting all files and folders inside dists, just run the project using the run button in your IDE (Android Studio) or just use flutter run -v command.

I hope this helps you. You know someone will benefit from this, share it with him/her, a friend or colleage.

waffarx cash back