0

Before marking this as duplicate.I tried this as well as this . I am using JDK 19 and gradle 7.6.1 for my project.

Downloading https://toolsproxy.tools.tsys.aws/repository/gradle/distributions/gradle-7.6-bin.zip
...........10%.....
Could not unzip /Users/apunamiya/.gradle/wrapper/dists/gradle-7.6-bin/4d7jnayiwkxx9wuev16n357bl/gradle-7.6-bin.zip to /Users/apunamiya/.gradle/wrapper/dists/gradle-7.6-bin/4d7jnayiwkxx9wuev16n357bl.
Reason: zip END header not found
Exception in thread "main" java.util.zip.ZipException: zip END header not found
    at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1483)
    at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1491)
    at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1329)
    at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1292)
    at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:710)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:243)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:172)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:186)
    at org.gradle.wrapper.Install.unzip(Install.java:250)
    at org.gradle.wrapper.Install.access$900(Install.java:42)
    at org.gradle.wrapper.Install$1.call(Install.java:96)
    at org.gradle.wrapper.Install$1.call(Install.java:63)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
    at org.gradle.wrapper.Install.createDist(Install.java:63)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)

What should I try or am i doing something wrong?

I am able to download the zip file from the URL which is getting used to download the gradle zip when i run the ./gradlew --version command. Not sure where I am going wrong.

I also tried running the command after deleting the .gradle folder , dists/gradle-7.6-bin , but still getting the same error

UPDATE: Tried switching my network, I am still getting the below on IntelliJ IDE Build error on IntelliJ IDE - Cause-zip END header not found

  • Seeing the download progress only reach 15% and then say "zip END header not found" leads to some strong suspicion about the claim that you are able to download it. It looks like it's being aborted only a short ways through. One thing you can check is the size of the download. It should be > 100MB. `~/.gradle/wrapper/dists/...` – User51 Apr 20 '23 at 13:12
  • It looks like the downloading is interrupted by some reason and you are getting the corrupted zip which is then fails to be extracted. You should check what that might be: an antivirus/firewall or a proxy in the network. – Andrey Apr 20 '23 at 16:20
  • Thanks @User51 and Andrey for the suggestions. The download was around 120 mb in size, but I tried changing the network and still I am getting the similar error or zip END header not found. – Ankit Punamiya Apr 21 '23 at 07:10
  • If it was me, I'd try a slightly adjusting a few things and seeing if it helps flush out the error... For example, do slightly different Gradle versions do the same? What about if you just use `gradle` instead of the wrapper `./gradlew`? Other deeper dives.. Can you navigate to that path and unzip it yourself? Can you MANUALLY download the zip from their website (don't know the URL), place it in the folder, and have it work? Things like that. A few manual things like this might at least tell you what's going on with it.... – User51 Apr 21 '23 at 13:29
  • I tried different things.. but somehow or the other this keeps coming up. I think the issue is with IntelliJ but even I am not sure. I am troubled with this. Would be grateful if i get this resolved. – Ankit Punamiya Apr 28 '23 at 06:00

0 Answers0