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

拟墨画扇 提交于 2019-12-23 07:28:21

问题


I am using Cordova for mobile application development.

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:

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

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.

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) version 1.9.3 compiled on December 23 2013.

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.


回答1:


I solved this same problem installing ant with a Windows installer contribution

https://code.google.com/p/winant/




回答2:


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

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

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.



来源:https://stackoverflow.com/questions/23321542/error-executing-command-ant-make-sure-you-have-ant-installed-and-added-to-y

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!