PhoneGap的生成失败,退出code 2 [英] Phonegap build fails with exit code 2

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

问题描述

我刚刚新安装的PhoneGap,当我尝试建立与下面的命令的项目有这个问题; 的PhoneGap构建Android

I just freshly installed phonegap and having this problem when I try to build the project with the following command ; "phonegap build android"

ANDROID_HOME : C:\Android\sdk

ANT_HOME : C:\apache-ant-1.9.4\

JAVA_HOME : C:\Program Files\Java\jdk1.8.0_45\

详细的控制台日志如下;

The detailed console log is as follows ;

Error : executing command 'ant' , make sure you have ant installed and added to your path. 
Command finished with error code 2: cmd ....\android\cordova\build.bat.
Error building one of the platforms. Error : cmd : command failed with exit code 2. 
You may not have the required environment or OS to build this project.

所以基本上说,ANT是行不通的。当我输入ANT进入命令提示符,它说蚂蚁无法识别。 %ANT_HOME /斌/蚂蚁工作虽然。

So it basically says that ANT is not working . When I type ANT into command prompt, it says ant is not recognized. %ANT_HOME/bin/ant works though.

当我做下面的ANT命令的作品,但随后的PhoneGap不被认可。

When I do the following ANT command works but then phonegap is not recognized.

set  PATH=%BASEPATH% 
 set ANT_HOME=C:\apache-ant-1.9.4\
 set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45\
 set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%

不知道如何解决呢?

Any idea how to solve it ?

推荐答案

那么它是那么的讨厌。结果
在我的应用程序文件夹中我没有​​发出以下命令。

Well it is so annoying.
In my app folder I did issue the following commands.

set ANT_HOME=C:\apache-ant-1.9.4\
set PATH=%PATH%;%ANT_HOME%\bin

和则PhoneGap的也是有效的。
ANT根本没有解决,除非我发出上述命令。
用了很长时间都尝试Ant命令的工作,但没有光。
即使它被定义为环境变量是根本行不通的。

And then the phonegap command works as well. Simply ANT is not resolved unless I issue the aforementioned commands. It took hours to try ANT command work but no light at all. It is simply not working even though it is defined as env variable.

编辑:如果您还每次发出的的PhoneGap构建命令(持续发生,我之后我PhoneGap的版本升级到5.0结束与minSDK错误.0),请记住,编辑的manifest.xml不会让因为它是由编译命令修改回原来的形式的原因不同。你需要做的是在WWW / config.xml文件来改变minSDK版本。

Edit : If you also end up with the minSDK error each time you issue the phonegap build command ( which keeps happening for me right after I upgraded phonegap version to 5.0.0) , please keep in mind that editing manifest.xml wont make a difference because of the reason that it is edited back to its original form by the build command. What you need to do is to change the minSDK version in the www/config.xml file.

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

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