错误:执行命令'ant',确保已安装ant并添加到路径中 [英] Error : Executing command 'ant', make sure you have ant installed and added to your path

查看:174
本文介绍了错误:执行命令'ant',确保已安装ant并添加到路径中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Cordova进行移动应用程序开发。

I am using Cordova for mobile application development.

我使用npm命令安装了Cordova,安装完成后,我创建了一个cordova项目。每当我尝试向项目添加平台(android)时,它都会抛出以下错误:

I have installed Cordova using npm command and after the installation, I have created a cordova project. Whenever I try to add a platform (android) to the project it throws following error:


错误:执行命令'ant',确保你安装了ant并添加到你的路径

Error : Executing command 'ant', make sure you have ant installed and added to your path

我已经在我的系统上安装了 ant 并配置了%ANT_HOME%\ bin 以及其他各自所需的平台,例如 JAVA_HOME ANDROID_PLATFORM_TOOLS ANDROID_TOOLS

I have already installed ant on my system and configured path to %ANT_HOME%\bin and other respective required platforms such as JAVA_HOME, ANDROID_PLATFORM_TOOLS and ANDROID_TOOLS.

每当我执行 ant 命令,不会抛出任何错误。例如,在cmd中执行 ant -version 命令后,收到的输出是:

Whenever I execute the ant command in cmd, no error's are thrown. For example, after the execution of ant -version command in cmd received output is:


Apache Ant(TM)1.9.3版于2013年12月23日编译。

Apache Ant(TM) version 1.9.3 compiled on December 23 2013.

我在Stack Overflow上遇到了很多问题并解决了JRE的 Lib 目录中没有出现 tools.jar 的问题。仍然平台添加无效。

I went through many of the questions at Stack Overflow and solved the issue of tools.jar not being present at JRE's Lib directory. still the platform add is not working.

请帮我解决这个问题。任何帮助将不胜感激。

Please do help me out with this. Any help will be appreciated.

推荐答案

最后,我能够找到问题的答案。

At last I was able to figure out the answer of my question.

经过漫长的一天,我尝试为同一个项目添加IOS平台,并通过cordova收到错误代码'ENOENT'。

After a long day, I tried adding IOS platform for same project and I received an error code 'ENOENT' through cordova.

我做了一些R& D,最后找到了一个解决方案 - 手机差距[错误] cmd:命令失败,退出代码ENOENT

I did some R&D and finally found a solution at -- Phone Gap [error] cmd: Command failed with exit code ENOENT

再次感谢大家的宝贵时间。

Again thank you all for your precious time.

这篇关于错误:执行命令'ant',确保已安装ant并添加到路径中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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