【问题标题】:could not run react-native application due to Exception in thread "main" java.util.zip.ZipException: error in opening zip file由于线程“main” java.util.zip.ZipException 中的异常,无法运行 react-native 应用程序:打开 zip 文件时出错
【发布时间】:2018-05-23 05:43:45
【问题描述】:

我已经尝试了很多解决方案。可能是 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

【问题讨论】:

    标签: android react-native gradle


    【解决方案1】:

    试试这个

    Cd 安卓

    ./gradlew clean

    镉..

    Sudo React-native run-android

    【讨论】:

    • 你用过sudo吗?
    • 是的,我做到了
    • 当我使用 sudo 时,它给了我同样的错误 zip 文件错误
    猜你喜欢
    • 2020-07-08
    • 1970-01-01
    • 1970-01-01
    • 2010-10-13
    • 1970-01-01
    • 2014-09-08
    • 1970-01-01
    • 2021-11-11
    • 1970-01-01
    相关资源
    最近更新 更多