Manoj
Manoj

Reputation: 1540

Error in setting Path for "ant" on Mac ( Cordova )

This is how I have set path on bash_profile file for my Cordova Project

export PATH=${PATH}:/Users/Work/Android/adt-bundle-mac-x86_64-20130219/sdk/platform-tools:/Users/Work/Android/adt-bundle-mac-x86_64-20130219/sdk/tools

export ANT_HOME=/Users/Work/Android/adt-bundle-mac-x86_64-20130219/eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730

export PATH=$PATH:$ANT_HOME/bin

When I try to run " cordova platform add android ", I got

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error: An error occured during creation of android sub-project. 

/Users/user1/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
                    throw e;
                          ^
Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.

Upvotes: 0

Views: 261

Answers (2)

Nurdin
Nurdin

Reputation: 23891

Try this one

Install ant using brew.

Download and install Homebrew by executing following command in terminal:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install Apache Ant via Homebrew by executing

brew install ant

Run the PhoneGap build again and it should successfully compile and install your Android app.

Upvotes: 2

MBillau
MBillau

Reputation: 5376

Try downloading a standalone version of ANT instead of using the one that comes packaged as an Eclipse plugin. The plugin version might be modified to run with Eclipse or might otherwise have some differences that are causing problems. Additionally, I'd think that a standalone version will be easier to upgrade.

On my machine, I'm running ant 1.8.4 - your plugin seems to be ant 1.8.3, so that might be what's causing the difference.

Upvotes: 1

Related Questions