命令行失败,退出代码8在phoneGap Cordova [英] Command line failed with exit code 8 in phoneGap Cordova

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

问题描述

我想从phonegap和cordova开始。

I am trying to start with phonegap and cordova.

我按照 http://phonegap.com/install/ 的步骤操作,但在命令 $ phonegap运行android 在命令提示符我得到以下错误:命令行失败,退出代码8

I follow step of http://phonegap.com/install/ , but at command $ phonegap run android in command prompt I get following error: Command line failed with exit code 8

我的cordova在商店在 C:\Users\MAC\.cordova\lib\android\cordova\3.4 .0\bin\lib 并且WinAnt位于 C:\Users\MAC\.cordova\lib\android\cordova\3.4。 0 \bin\lib\WinAnt

My cordova in store is at C:\Users\MAC\.cordova\lib\android\cordova\3.4.0\bin\lib and WinAnt is at C:\Users\MAC\.cordova\lib\android\cordova\3.4.0\bin\lib\WinAnt.

推荐答案

退出代码8',我从另一台机器上复制我的工作区,并尝试在新机器上的运行命令。

phonegap运行android命令将从platforms \android目录执行ant。
自行执行,您可能会看到更详细的错误消息。

I had 'command line failed with exit code 8' after I copied my workspace from another machine and tried the 'run' command on the new machine.
The 'phonegap run android' command will execute ant from the platforms\android directory. Execute it yourself and you may see a more detailed error message.

cd platforms/android  
ant  

这样做帮助我找出问题的原因 - 额外的错误信息蚂蚁给我突出显示我的Android开发工具包(ADT)安装不在ant所期望的位置。它必须在平台添加时写入build命令。

我通过(我使用cordova)删除和重新添加android支持,如下:

Doing this helped me to identify the cause of my issue - the additional error information ant gave me highlighted that my Android Development Toolkit (ADT) installation was not at the location that ant was expecting. It must get written into the build command at the time the platform gets added.
I fixed this by (I'm using cordova) removing and re-adding android support as follows:

cordova platform remove android  
cordova platform add android  

您也可以这样做。我猜你可以用'phonegap'替换上面的命令中的'cordova',并执行它们,看看是否修复它。 (我假设你已经安装了Android开发工具集(ADT) - 如果没有,那可能是问题,你应该安装它!)

You may be able to do the same. I'm guessing you can replace 'cordova' in the above commands with 'phonegap' and execute them to see if that fixes it. (I assuming you have already installed the Android Development Toolset (ADT) - if not, then that is probably the issue and you should install it!)

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

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