当前位置: 代码迷 >> 综合 >> react-native run-android Exception in thread “main” java.util.zip.ZipException: error in opening zip
  详细解决方案

react-native run-android Exception in thread “main” java.util.zip.ZipException: error in opening zip

热度:68   发布时间:2023-12-26 02:35:23.0

https://stackoverflow.com/questions/40814686/react-native-run-android-exception-in-thread-main-java-util-zip-zipexception

react-native run-android Exception in thread “main” java.util.zip.ZipException: error in opening zip file


up vote
down votefavorite

I try to

react-native run-android 

and meet this problem

JS server already running.
Running C:\Users\丶丶困困兽兽犹犹斗斗\AppData\Local\Android\sdk/platform-tools/adb -s 192.168.76.101:5555 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && gradlew.bat installDebug...
Unzipping C:\Users\丶丶困困兽兽犹犹斗斗\.gradle\wrapper\dists\gradle-2.4-all\6r4uqcc6ovnq6ac6s0txzcpc0\gradle-2.4-all.zip to C:\Users\丶丶困困兽兽犹犹斗斗\.gradle\wrapper\dists\gradle-2.4-all\6r4uqcc6ovnq6ac6s0txzcpc0Exception in thread "main"    java.util.zip.ZipException: error in opening zip fileat java.util.zip.ZipFile.open(Native Method)at java.util.zip.ZipFile.<init>(ZipFile.java:114)at java.util.zip.ZipFile.<init>(ZipFile.java:131)at org.gradle.wrapper.Install.unzip(Install.java:159)at org.gradle.wrapper.Install.access$500(Install.java:26)at org.gradle.wrapper.Install$1.call(Install.java:69)at org.gradle.wrapper.Install$1.call(Install.java:46)at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)at org.gradle.wrapper.Install.createDist(Install.java:46)at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

SDK works well and can find device in adb devices

share improve this question
  • Hi Wenpeng. Have you solved this yet? – cricket_007  Nov 28 '16 at 5:08
  • not yettttttttt – Wenpeng Qu  Dec 14 '16 at 7:12
add a comment

5 Answers

activeoldestvotes
up vote 1down vote

Content in file gradle-2.4-all error. Please delete content in gradle-2.4-all (~/.gradle\wrapper\dists\gradle-2.4-all...) then re-compile .. it will auto download file.

share improve this answer
add a comment
up vote 3down vote

I have the same problem as yours! Because when I first run "react-native run-android", my INTERNET is SLOW and LAGCORRUPTED. This bad internet connection lets to download a TEMPORARY DAMAGE file gradle....zip. Solution: Just go in that path contains that file zip, delete it then run again! It worked for me!

share improve this answer
add a comment
up vote 0down vote

The gradle-2.4-all.zip was damaged,so it should be replaced with a new gradle-2.4-all.zip

share improve this answer
add a comment
up vote 6down vote

The problem is Unable to Unzip your gradle-2.4-all.zip, So please Delete the existing file

gradle-2.4-all.zip

from your folder :

C:\Users\丶丶困困兽兽犹犹斗斗.gradle\wrapper\dists\gradle-2.4-all\6r4uqcc6ovnq6ac6s0txzcpc0\

Download a fresh gradle-2.4-all.zip file and place it on the same folder as we deleted and try again to run your code : react-native run-android

It may work.You can download gradle zip file from the below Link: https://services.gradle.org/distributions

share improve this answer
  相关解决方案