0

I wanted to give Phonegap a try so I downloaded and installed and started following this guide in the phonegap docs: http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface

I've created a new project and installed ios platform with the command mentioned in the guide and tried doing the same for the android platform:

cordova platform add android

I'm getting the following error:

Creating android project...

/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/ophir/.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.
at /Users/ophir/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:47:27
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

at /usr/local/lib/node_modules/cordova/src/platform.js:244:30
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

I see that I have ant missing (used to have it before re-installing my mac os). how can I install ant?

Thanks

developer82
  • 13,237
  • 21
  • 88
  • 153

2 Answers2

0

If you installed mavericks this solution will most likely work for you

https://stackoverflow.com/a/19495611/611547

Community
  • 1
  • 1
Shikiju
  • 722
  • 2
  • 9
  • 18
0

Your issue that ant is not installed so you have to install ant first then run this command to make sure that your ant is ok, then phone gap should run smoothly:

ant -h
Hazem Hagrass
  • 9,329
  • 10
  • 32
  • 54