Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Screenshot

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.

like image 279
Anurag Sharma Avatar asked Apr 27 '14 09:04

Anurag Sharma


People also ask

How do you check if ants is installed?

You can check whether ANT is successfully installed by running the following command into the command prompt: ant –version - The Official 360logica Blog.

Where is ant installed?

Installing Apache Ant Unzip the zip file to a convenient location c:\folder by using Winzip, winRAR, 7-zip or similar tools. Create a new environment variable called ANT_HOME that points to the Ant installation folder. In this case, it is c:\apache-ant-1.10. 12-bin folder.


2 Answers

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

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

like image 84
Sultanos Avatar answered Oct 10 '22 13:10

Sultanos


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.

like image 27
Anurag Sharma Avatar answered Oct 10 '22 11:10

Anurag Sharma