Error: android: Command failed with exit code 1

Hi guys, I’ve searched for the past 4 hours and have tried everything suggested but cannot get the ionic emulate android command to run. I can successfully get the command ionic build android to build the package but cannot emulate it running ionic emulate android. I just get Error: android: Command failed with exit code 1

I’m running the latest version of android studio that I installed this morning.

Any help would be appreciated.


I set up Ionic 2 just yesterday and have the same problem. The sample myApp builds fine but emulate gets exit code 1.

My workaround is to start the emulator first. Either open Android Studio on some project, e.g., HelloWorld, and run to start the emulator, or run the command line as follows. First get the name of an existing virtual device with

avdmanager list avd

I had a Nexus 5 virtual device. I had ANDROID_HOME set to the directory containing the sdk directory, so I started the emulator with

$ANDROID_HOME/sdk/emulator/emulator -avd Nexus_5X_API_25 &

(Note emulator is not in tools or platform-tools and note the & which means start this process in the background. If you forget the &, just start a separate command window.)


ionic emulate android

works for me.

1 Like