Cordova 3.4.0-0.1.3添加android平台错误 [英] Cordova 3.4.0-0.1.3 adding android platform Error

查看:175
本文介绍了Cordova 3.4.0-0.1.3添加android平台错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我添加平台,我得到这个错误如何解决:

  C:\Users\SCube\ .cordova \lib\android\cordova\3.4.0\bin\\\
ode_modules\q\q.js:126
throw e;
^
错误:错误:执行命令'ant',确保您已安装ant并将
ed添加到您的路径。
at C:\Users\SCube\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js:4
7: 27
在ChildProcess.exithandler(child_process.js:641:7)
在ChildProcess.EventEmitter.emit(events.js:98:17)
at maybeClose(child_process.js:743: 16)
在Process.ChildProcess._handle.onexit(child_process.js:810:5)
错误:cmd:命令失败,退出代码8
在ChildProcess.whenDone(C:\ Users \SCube \AppData\Roaming\\\
pm\\\
ode_modules\co
rdova \src\superspawn.js:112:23)
在ChildProcess.EventEmitter.emit(事件。 js:98:17)
at maybeClose(child_process.js:743:16)
在Process.ChildProcess._handle.onexit(child_process.js:810:5)

感谢

解决方案

,当您的路径设置不适合Android应用程序。请按照 BLOG 在Windows计算机中添加Android平台



也可以尝试在Windows上设置PATH环境变量 p>


  • 列表项从桌面右键单击我的电脑,然后单击属性。


  • 点击左侧列中的高级系统设置链接。


  • 在系统属性窗口中点击环境变量按钮。 / li>

  • 从系统变量部分选择PATH变量。



  • 您需要将路径添加到Android SDK platform-tools和tools目录。在我的示例中,我将使用C:\Development\android-sdk-windows作为SDK安装目录。将以下文本附加到文本框中:
    ; C:\Development\android-sdk-windows\platform-tools; C:\Development\android-sdk-windows \tools


  • 保存编辑。关闭环境变量对话框。


  • 此外,您可能需要将%JAVA_HOME%\bin包括在PATH中。要检查是否需要这样做,请运行命令提示符并键入java。如果无法找到程序,请将%JAVA_HOME%\bin添加到PATH。您可能需要指定完整路径,而不是使用%JAVA_HOME%环境变量。


  • 最后,您可能需要包括%ANT_HOME%\bin你的PATH以及。要检查是否需要这样做,请运行命令提示符并键入ant。如果找不到程序,则将%ANT_HOME%\bin添加到PATH。您可能需要指定完整路径,而不是使用%ANT_HOME%环境变量。



    有关详细信息,请参阅这里



When i add platform i am getting this error how to resolve :

C:\Users\SCube\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:126
                        throw e;
                              ^
    Error: ERROR : executing command 'ant', make sure you have ant installed and add
    ed to your path.
        at C:\Users\SCube\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js:4
    7:27
        at ChildProcess.exithandler (child_process.js:641:7)
        at ChildProcess.EventEmitter.emit (events.js:98:17)
        at maybeClose (child_process.js:743:16)
        at Process.ChildProcess._handle.onexit (child_process.js:810:5)
    Error: cmd: Command failed with exit code 8
        at ChildProcess.whenDone (C:\Users\SCube\AppData\Roaming\npm\node_modules\co
    rdova\src\superspawn.js:112:23)
        at ChildProcess.EventEmitter.emit (events.js:98:17)
        at maybeClose (child_process.js:743:16)
        at Process.ChildProcess._handle.onexit (child_process.js:810:5)

Thanks

解决方案

This error occurs, when your path is not set proper for Android Application.Please follow this BLOG for adding Android Platform in Windows Machine

Can try this also to Setup your PATH environment variable on Windows

  • List item From the Desktop, right-click My Computer and click Properties.

  • Click Advanced System Settings link in the left column.

  • In the System Properties window click the Environment Variables button.

  • Select the PATH variable from the System variables section.

  • Select the Edit button. You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "C:\Development\android-sdk-windows" as the directory the SDK is installed in. Append the following text into the text box: ;C:\Development\android-sdk-windows\platform-tools;C:\Development\android-sdk-windows\tools

  • Save your edit. Close the Environment Variables dialog.

  • Additionally, you may need to include %JAVA_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type java. If the program can not be found add %JAVA_HOME%\bin to the PATH. You may need to specify the full path instead of using the %JAVA_HOME% environment variable.

  • Finally, you may need to include %ANT_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type ant. If the program can not be found add %ANT_HOME%\bin to the PATH. You may need to specify the full path instead of using the %ANT_HOME% environment variable.

    For More details You can refer HERE

这篇关于Cordova 3.4.0-0.1.3添加android平台错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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