PhoneGap的:命令失败,退出code 8 [英] Phonegap: Command failed with exit code 8

查看:166
本文介绍了PhoneGap的:命令失败,退出code 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了​​一个环境的PhoneGap发展,我得到了一些麻烦,最终构建和运行为Android的应用程序。

I'm setting up an environment for Phonegap developing, and I'm getting some trouble to finally build and run an app for Android.

当我试图为Android打造执行,我得到了以下错误:

When I try to execute build for Android, I got the following error:

Running: C:\Users\Renan\workspace_html5\FIAP\Phonegap\phonegap-test\test\platfor
ms\android\gradlew cdvBuildDebug -b C:\Users\Renan\workspace_html5\FIAP\Phonegap
\phonegap-test\test\platforms\android\build.gradle -Dorg.gradle.daemon=true

Unzipping C:\Users\Renan\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oi
ejfej094b\gradle-2.2.1-all.zip to C:\Users\Renan\.gradle\wrapper\dists\gradle-2.
2.1-all\2m8005s69iu8v0oiejfej094b


Exception in thread "main"
java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip fil
e

        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.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:48)


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(ExclusiveFileAcc
essManager.java:65)

        ... 3 more



C:\Users\Renan\workspace_html5\FIAP\Phonegap\phonegap-test\test\platforms\androi
d\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s /c "C:\Users\Renan\workspace_html5\F
IAP\Phonegap\phonegap-test\test\platforms\android\gradlew cdvBuildDebug -b C:\Us
ers\Renan\workspace_html5\FIAP\Phonegap\phonegap-test\test\platforms\android\bui
ld.gradle -Dorg.gradle.daemon=true"

ERROR building one of the platforms: Error: C:\Users\Renan\workspace_html5\FIAP\
Phonegap\phonegap-test\test\platforms\android\cordova\build.bat: Command failed
with exit code 8
You may not have the required environment or OS to build this project

Error: C:\Users\Renan\workspace_html5\FIAP\Phonegap\phonegap-test\test\platforms
\android\cordova\build.bat: Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\Renan\AppData\Roaming\npm\node_modules\ph
onegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:1
31:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

一些细节:


  • 我在Windows上运行的8.1;

  • 我使用的是Android SDK中22;

  • 我已经创建环境变量JDK,Android的(工具,构建工具和平台工具),An​​t和摇篮。

任何想法,为什么我收到此错误?

Any ideas why am I getting this error?

感谢您。

推荐答案

我已经成功地解决了这个问题,所以,在任何人的情况下,也有类似的麻烦,这里有云我已经经历的情况。

I have already managed to solve this problem, so, in case of anyone has a similar trouble, here it goes the situation I've gone through.

当我执行第一个构建,PhoneGap的尝试下载并解压它自己gradle这个分布,并且他试图从后续下载:

When I performed the first build, phonegap attempted to download and extract it's own gradle distribution, and he was attempting to download it from the follow:

http://services.gradle.org/distributions/gradle- 2.2.1-all.zip

的时候,我连大学的网络上,而这个URL阻断它的代理。由于我没有能够达到上述网址,所有的PhoneGap能做的就是得到一个损坏的zip文件,所以这是该异常已被倒掉的原因。

By the time, I was connected on university's network, and this URL was blocked by it's proxy. Since I wasn't able to reach the URL above, all Phonegap could do was to get a corrupted zip file, so that was the reason that exception has been throwed.

甚至当我删除〜/ .gradle,我试图建立在同一个网络上。

Even when I deleted ~/.gradle, I was trying to build on the same network.

因此​​,为了解决这个问题,我刚删除.gradle目录,并使用另一个网络连接运行构建

So, in order to solve this problem, I have just deleted .gradle directory and run the build using another network connection.

这篇关于PhoneGap的:命令失败,退出code 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆