Installing PhoneGap, error executing command 'ant'
android, ant, cordova, node.js
Solution
Probably you have a new version of cordova, i saw that in a partner machine was installed the cordova version 3.5.0 and in my machine it was installed the 3.4.0 version, maybe the ant version is incompatible with the new version of cordova (He and i has the ant version 1.9.4) .
Try install a old version of cordova with this command in the node.js console:
npm install -g cordova@3.4.0-0.1.0
and run the command again.
Other cause: Verify that your Path Variables are configured correctly..
My english is not pretty good, but i hope help you to solve the problem.
Problem
When installing PhoneGap via nodeJS i got an error when trying to run my app (installing phonegap and creating the app worked): ``` C:\Users\arko\my-app>phonegap run android [phonegap] detecting Android SDK environment... [phonegap] using the local environment [phonegap] adding the Android platform... [error] An error occured during creation of android sub-project. C:\Users\arko\.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 add ed to your path. at C:\Users\arko\.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:465:12) ``` So I noticed I never had ANT installed, so I did. I followed this tutorial: http://cleancodedevelopment-qualityseal.blogspot.nl/2012/11/how-to-install-phonegap-for-android.html and done everything it said. The part it says you have to add stuff to the Path variable, it said just add this: %ANT_HOME%\bin; however my Path ended with this: C:\Program Files\Windows Live\Shared - so I added this to it: ;%ANT_HOME%\bin; Tried to run the android app again, and got the same error. I ran it with this command: ``` phonegap run android ``` What am I doing wrong? Thanks!