Reputation: 846
I am using phonegap and have just started going through this tutorial here.
I am trying to add Android platform and getting this error:
C:\Users\Manu>cd hello
C:\Users\Manu\hello>cordova platform add android
Creating android project...
C:\Users\Manu\.cordova\lib\android\cordova\3.5.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 C:\Users\Manu\.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.js:47:27
at ChildProcess.exithandler (child_process.js:651:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Socket.<anonymous> (child_process.js:966:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Manu\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
How can I fix this?
Upvotes: 1
Views: 5555
Reputation: 1313
I had the same issue and found out that it was due to a bug in Ant. My Classpath ended with a " too, and I had to fix this by updating my class path. Instead of:
"C:\Program Files\Something\here"
I used:
C:\Progra~1\Something\here
and now it works.
Upvotes: 0
Reputation: 1545
You are missing an Apache Ant installation.
ANT_HOME
which points to the bin
directory of your installation pathPATH
environment variableThat should fix your problem.
Upvotes: 0
Reputation: 111
Your problem is actually the adt path is not recognised, follow below steps.
I am sharing with you the steps to create android PhoneGap app with cordova 3.4 version :-
1) Download and install Node.js.
2) Run this command on your terminal :-
$ sudo npm install -g cordova
3) Then create your project using following command :-
$ cordova create hello com.example.hello HelloWorld
4) Then before adding any platform , run the following command....Replace the path of android sdk with your system path :-
$ export PATH=${PATH}:/Users/taruna/Documents/adt-bundle-mac-x86_64-20131030/sdk/platform-tools:/Users/taruna/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools
5) Now add your platform using following command :-
$ sudo cordova platform add android
6) Now you can successfully run your project on emulator using following command :-
$ cordova emulate android
And its done now.
Upvotes: 1