Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command line failed with exit code 8 in phoneGap Cordova

Tags:

cordova

I am trying to start with phonegap and cordova.

I follow step of http://phonegap.com/install/ , but at command $ phonegap run android in command prompt I get following error: Command line failed with exit code 8

My cordova in store is at C:\Users\MAC\.cordova\lib\android\cordova\3.4.0\bin\lib and WinAnt is at C:\Users\MAC\.cordova\lib\android\cordova\3.4.0\bin\lib\WinAnt.

like image 771
Nirav Mehta Avatar asked May 07 '14 09:05

Nirav Mehta


2 Answers

I had 'command line failed with exit code 8' after I copied my workspace from another machine and tried the 'run' command on the new machine.
The 'phonegap run android' command will execute ant from the platforms\android directory. Execute it yourself and you may see a more detailed error message.

cd platforms/android  
ant  

Doing this helped me to identify the cause of my issue - the additional error information ant gave me highlighted that my Android Development Toolkit (ADT) installation was not at the location that ant was expecting. It must get written into the build command at the time the platform gets added.
I fixed this by (I'm using cordova) removing and re-adding android support as follows:

cordova platform remove android  
cordova platform add android  

You may be able to do the same. I'm guessing you can replace 'cordova' in the above commands with 'phonegap' and execute them to see if that fixes it. (I'm assuming you have already installed the Android Development Toolset (ADT) - if not, then that is probably the issue and you should install it!)

like image 193
roj Avatar answered Sep 19 '22 03:09

roj


I case anyone else is breaking his head over what could be causing the 'exit code 8' error: make sure you don't start your project name with a number! I tried all the other solutions before I figured that out...

like image 22
DrSiemer Avatar answered Sep 20 '22 03:09

DrSiemer