加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react native Exception in thread "main" java

发布时间:2020-12-15 05:12:22 所属栏目:百科 来源:网络整理
导读:1.问题 D:rnworkspaceHelloreact-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

1.问题

D:rnworkspaceHello>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:Usersltn.gradlewrapperdistsgradle-2.4-all6r4uqcc6ovnq6ac6s0tx
zcpc0gradle-2.4-all.zip to C:Usersltn.gradlewrapperdistsgradle-2.4-all6r
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(ExclusiveFileAcc
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:Usersxxxx.gradlewrapperdistsgradle-2.4-all下,重新运行

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读