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
.
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!)
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With