Error ionic platform add android


#1

Hello !

when I go to command:
ionic platform add android

Show following error:

/Users/guilhermeferreira/.cordova/lib/android/cordova/3.5.1/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.
at /Users/guilhermeferreira/.cordova/lib/android/cordova/3.5.1/bin/lib/check_reqs.js:47:27
at ChildProcess.exithandler (child_process.js:652:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Socket. (child_process.js:969:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
Error: /Users/guilhermeferreira/.cordova/lib/android/cordova/3.5.1/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)

which can be ???


#2

Are you using Windows?


#3

It appears that you are using Mac (/Users/…), so you’ll have to do this. Download the latest version of Apache Ant:

http://supergsego.com/apache//ant/binaries/apache-ant-1.9.4-bin.zip

Extract it to a directory of your choice and then add it to your ~/.profile. Something like this will do:

export PATH=$PATH:/path/to/ant/bin

Log out of your Mac session and with a little luck you should be good to go.


#4

I am using windows and had to install apache ant and add the bin directory to my path to get it to work.


#5

nicraboy, that was it.

Thanks.