Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova emulate android Exit Code 1

I have code that is building successfully through cordova. However, when I try to emulate it, I get this error "Error:cmd: Command failed with exit code 1". Any ideas on how to fix this?Here is my output from attempting to emulate the code

like image 991
Rachel Bilbo Avatar asked Mar 30 '17 14:03

Rachel Bilbo


1 Answers

I had the same problem. It looks like you don't have any AVD running. I don't think ionic's tutorial specifies that you need to do that. I assume you're following this guide.

To fix the issue (if the error in your case is also caused by the lack of Android Virtual Device running) simply:

  1. Start Android Studio.

  2. Navigate to Tools -> Android -> AVD Manager.

  3. Create virtual device (button on the bottom left corner).

  4. Set up the device by configuring it to suit your needs.

  5. Run the virtual device by pushing the green triangle in AVD Manager, under "Actions" column (a new window with the emulated phone should pop up).

  6. Run the ionic emulate android command again.

Note that if you - for some reason - don't have "Android" submenu under "Tools" menu (that was my first issue), you have to simply start the Android Studio installer once more and reinstall it, making sure you check the box for Android Virtual Device during installation.

like image 172
m3h0w Avatar answered Oct 13 '22 19:10

m3h0w