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

未结帖
0 779
ajian admin_jim 2017-12-06
悬赏:5飞吻

转自:http://blog.csdn.net/u010411264/article/details/53636956

1.问题

D:\rnworkspace\Hello>React-native run-Android 
JS server already running. 
Building and installing the app on the device (cd android && gradlew.bat install 
Debug)… 
Downloading https://services.gradle.org/distributions/gradle-2.4-all.zip 
…………………………………………………………………….. 
…………………………….. 
Unzipping C:\Users\ltn.gradle\wrapper\dists\gradle-2.4-all\6r4uqcc6ovnq6ac6s0tx 
zcpc0\gradle-2.4-all.zip to C:\Users\ltn.gradle\wrapper\dists\gradle-2.4-all\6r 
4uqcc6ovnq6ac6s0txzcpc0 
Exception 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:215)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at java.util.zip.ZipFile.<init>(ZipFile.java:159)
    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(ExclusiveFileAcc12345678910

essManager.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) 
Could not install the app on the device, read the error above for details. 
Make sure you have an Android emulator running or a device connected and have 
set up your Android development environment: 
https://facebook.github.io/react-native/docs/android-setup.html

(node:5276) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec

tion id: 2): TypeError: Cannot read property ‘message’ of undefined

2.解决

这问题原因是在你创建工程gradle-2.4-all包下载不完全或者没有下载所致。 
1.你可以重新创建工程。 
2.下载http://pan.baidu.com/s/1b2Vb2Y包,放在C:\Users\xxxx.gradle\wrapper\dists\gradle-2.4-all下,重新运行

或者使用迅雷 新建下载任务 https://services.gradle.org/distributions/gradle-2.14.1-all.zip  然后放置在如下对应的后面一长串字符的文件夹(先清空后面一长串字符的文件夹

gradle.png



热忱回答0


最近热帖

近期热议

  1. javascript——prototype与__proto 9
  2. Mysql 中出现的Data truncated for column 3
  3. 在nginx中使用x-sendfile的解决方案 3
  4. 高版本jQuery面插件实现Ajax上传图片 1
  5. Thinkphp Socket.class.php 类的使用 1
  6. 使用ionic3创建第一个App 0
  7. ios-oc html5 0
  8. nginx.conf 0
  9. 基于ionic3.4.0的项目搭建 0
  10. php 缩略图 0