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

查看:29
本文介绍了错误:正在执行命令“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_TOOLSANDROID_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.

每当我在 cmd 中执行 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 上解决了许多问题,并解决了 tools.jar 不在 JRE 的 Lib 目录中的问题.仍然 platform add 不起作用.

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.

我做了一些研发,终于在--Phone Gap [error] 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天全站免登陆