由于线程“main”java.util.zip.ZipException中的异常导致无法运行react-native应用程序:打开zip文件时出错

时间:2018-05-23 05:43:45

标签: android react-native gradle

我尝试了很多解决方案。可能是zip下载中断或未成功完成。但我通过克隆我的回购制作一个新项目,这给了我同样的错误。我也试过从我的项目的主文件夹删除gradle目录。并且gradle目录中没有dist文件夹或zip文件。这是完整的错误日志

Unzipping /var/root/.gradle/wrapper/dists/gradle-4.1- 
all/bzyivzo6n839fup2jbap0tjew/gradle-4.1-all.zip to 
/var/root/.gradle/wrapper/dists/gradle-4.1all/bzyivzo6n839fup2jbap0tjew
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:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.zip.ZipFile.<init>(ZipFile.java:169)
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)
 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/getting-started.html

1 个答案:

答案 0 :(得分:0)

试试这个

cd android

./ gradlew clean

Cd ..

Sudo React-native run-android