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

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 file
    at 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

  • 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

5 Answers

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.

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!

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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值