我希望有人能帮助我.. 我正在使用Mac OS X并尝试构建我的gradle项目 我一直遇到以下问题:
Generating app in /Users/AsafM/Desktop/untitled
Executing '/Users/AsafM/Desktop/untitled/gradlew clean --no-daemon eclipse afterEclipseImport'
Unzipping /Users/AsafM/.gradle/wrapper/dists/gradle-1.11-all/7qd8qq8te5j4f5q9aaei3gh3lj/gradle-1.11-all.zip to /Users/AsafM/.gradle/wrapper/dists/gradle-1.11-all/7qd8qq8te5j4f5q9aaei3gh3lj
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: 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:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.zip.ZipFile.<init>(ZipFile.java:164)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
Done!
To import in Eclipse: File -> Import -> General -> Exisiting Projects into Workspace
To import to Intellij IDEA: File -> Open -> YourProject.ipr
任何解决方案?
答案 0 :(得分:1)
或者,您可以从http://www.gradle.org/downloads手动下载gradle-1.11-all.zip文件以替换损坏的文件。
正在发生的事情是LibGDX正在尝试提取文件,但zip文件已损坏。所以用干净的副本替换文件是有效的,或者如果你删除它,LibGDX会自动为你下载它,所以它真的是一样的。
答案 1 :(得分:0)
我也遇到过这个问题。我的解决方案是去#&#34; dist&#34;在.gradle目录中删除所有这些,然后成功创建libgdx项目。
答案 2 :(得分:0)
谢谢,但我最终通过以下方式解决了这个问题:
答案 3 :(得分:0)
转到/ gradle / wrapper / gradle-wrapper-properties
更改:distributionUrl为
distributionUrl = http://services.gradle.org/distributions/gradle-2.2-all.zip