Boyan Hristov
Boyan Hristov

Reputation: 1102

Cannot properly install ant using phonegap, windows 7 and android SDK

I am trying to start developing a phonegap app, but unfortunately every time I try to run the following command "cordova platform add android" I get this error "Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.". Here is how I have set up ant and everything that has something to do with phonegap development in PATH.

Variable                                      Value

ANDROID_HOME                        C:\Development\adt-bundle\sdk
ANT_HOME                                  C:\Development\apache-ant-1.9.4
JAVA_HOME                                C:\Program Files\Java\jdk1.8.0_05
PATH                                           C:\Users\Admin\AppData\Roaming\npm;%JAVA_HOME%
                                                    \bin;%ANT_HOME\bin;%ANDROID_HOME%\platform-                                                                                              tools;%ANDROID_HOME%\tools;

Upvotes: 3

Views: 817

Answers (1)

sunbabaphu
sunbabaphu

Reputation: 1493

  • download apache-ant-1.9.4-bin.zip from here: http://ant.apache.org/bindownload.cgi

  • unzip the ant zip into the folder C:\Development. this will automatically create the following folder: C:\Development\apache-ant-1.9.4-bin with the contents of the .zip inside this folder.

  • either change your ANT_HOME to C:\Development\apache-ant-1.9.4-bin\apache-ant-1.9.4 OR browse to C:\Development\apache-ant-1.9.4-bin, cut the folder apache-ant-1.9.4 and paste it directly under C:\Development so that the /bin, /lib, /ect .. folders are directly under C:\Development\apache-ant-1.9.4.

  • now when you run ant -version in the command-prompt it should return the Ant version installed on your system.

Upvotes: 2

Related Questions