0
votes

ionic build android error gradle error

Exception in thread "main"

java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file

at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)

at org.gradle.wrapper.Install.createDist(Install.java:47)

at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)

at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)

Caused by: java.util.zip.ZipException: error in opening zip file

at java.util.zip.ZipFile.open(Native Method)

at java.util.zip.ZipFile.(ZipFile.java:219)

at java.util.zip.ZipFile.(ZipFile.java:149)

at java.util.zip.ZipFile.(ZipFile.java:163)

at org.gradle.wrapper.Install.unzip(Install.java:160)

at org.gradle.wrapper.Install.access$400(Install.java:29)

at org.gradle.wrapper.Install$1.call(Install.java:70)

at org.gradle.wrapper.Install$1.call(Install.java:47)

at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)

... 3 more

Failed to install 'cordova-plugin-console':Error: /node/Palaroo/platforms/android/gradlew: Command failed with exit code 1

at ChildProcess.whenDone (/node/Palaroo/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)

at emitTwo (events.js:106:13)

at ChildProcess.emit (events.js:191:7)

at maybeClose (internal/child_process.js:877:16)

at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Error: /node/Palaroo/platforms/android/gradlew: Command failed with exit code 1

Can any one provide solution for this

2
are you using windows or mac...Utpaul
Improve formattingsmartrahat

2 Answers

1
votes

Just delete the folder /home/USER-NAME/.gradle/wrapper/dists/

Its happening because your gradle zip file has not downloaded correctly delete it and run the command again.

0
votes

If faced error while building ionic build android

then got to this path on mac and delete everything

/var/root/.gradle/wrapper/dists/gradle-2.14.1-all/

If faced error while building ionic build android

then

got to this path on mac and delete everything

/var/root/.gradle/wrapper/dists/gradle-2.14.1-all/

/var/root/.gradle/wrapper/dists/gradle-2.14.1-all/nzipping

/var/root/.gradle/wrapper/dists/gradle-2.14.1-all/53l0mv9mggp9q5m2ip574m21oh/gradle-2.14.1-all.zip 

to

/var/root/.gradle/wrapper/dists/gradle-2.14.1-all/53l0mv9mggp9q5m2ip574m21oh

This solves the problem