# Ionic run android fails

**URL:** <https://forum.ionicframework.com/t/ionic-run-android-fails/20654>\
**Category:** ionic-v1\
**Created:** [April 10, 2015, 2:25am UTC](https://forum.ionicframework.com/t/ionic-run-android-fails/20654 "2015-04-10T02:25:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkosenko](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@pkosenko](https://forum.ionicframework.com/u/pkosenko)\
**Post date:** [April 10, 2015, 2:25am UTC](https://forum.ionicframework.com/t/ionic-run-android-fails/20654/1 "2015-04-10T02:25:43Z")

</div>

This must be a common question. I have just installed IONIC on windows 7. I get all the way to “ionic build android”, which runs fine. But when I try “ionic run android” for my test project, I get an error:

ERROR running one or more of the platforms: Error: c:\ . . . \ionic\proj1\myApp\platforms\android\cordova\run.bat: Command failed with exit code 2  
You may not have the required environment or OS to run this project

Any clue why the last run step should fail? I installed the full Android 22 development environment.

---

<div class="post-metadata">

**Author:** ![em57](https://avatars.discourse-cdn.com/v4/letter/e/13edae/32.png) [@em57](https://forum.ionicframework.com/u/em57)\
**Post date:** [April 10, 2015, 4:57am UTC](https://forum.ionicframework.com/t/ionic-run-android-fails/20654/2 "2015-04-10T04:57:43Z")

</div>

I think this [ticket](https://github.com/driftyco/ionic-cli/issues/282) on github is related to your question, check it out

---

<div class="post-metadata">

**Author:** ![pkosenko](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@pkosenko](https://forum.ionicframework.com/u/pkosenko)\
**Post date:** [April 10, 2015, 9:44pm UTC](https://forum.ionicframework.com/t/ionic-run-android-fails/20654/3 "2015-04-10T21:44:32Z")

</div>

Thanks. I’ll post if and when I have an answer. I was wondering whether it might be a version issue – i.e., the latest Android got ahead of Ionic. However, I haven’t read the complete github entry yet. Will get back later.

---

<div class="post-metadata">

**Author:** ![pkosenko](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@pkosenko](https://forum.ionicframework.com/u/pkosenko)\
**Post date:** [April 13, 2015, 10:45pm UTC](https://forum.ionicframework.com/t/ionic-run-android-fails/20654/4 "2015-04-13T22:45:42Z")

</div>

The “tab” project I downloaded has an androidManifest.xml file in “project/platform/android” that specifies SDK version 21, but the the Android 22 installer does not automatically install previous versions.

So the first thing I did was install Android 21 using the Android manager.

I still had problems building. Save some JS errors. I upgraded Node from 0.10.32 to 0.12.2, but that didn’t help (but it didn’t hurt).

Then I noticed that I had put “tools” at the end of my ANDROID\_HOME environment path and removed that.

That enabled build, but now I am getting an error that there is no emulator in which to run the build with the “ionic run android” command line. But the error messages give some guidance about fixing that. I’ll get back when I fix that.

---

<div class="post-metadata">

**Author:** ![em57](https://avatars.discourse-cdn.com/v4/letter/e/13edae/32.png) [@em57](https://forum.ionicframework.com/u/em57)\
**Post date:** [May 29, 2015, 9:48am UTC](https://forum.ionicframework.com/t/ionic-run-android-fails/20654/5 "2015-05-29T09:48:12Z")

</div>

> [@pkosenko](#):
>
> I am getting an error that there is no emulator in which to run the build with the “ionic run android” command line

If this error appears to anyone, it means exactly what it states.

Ionic Team, currently, does not recommend using the android emulator because it is slow, instead, connecting an **android device** via **USB** and run and build on the real device for your tests is recommended. This will allow you also to test all the native functionality you have implemented.

Or alternatively, use GenyMotion emulator. If for some reason you have to use android emulator, then you need to create new android devices from the **Android AVD** manager which you start like so

```
android avd 

```

which will open the Android Virtual Device Manager then you can create new ones (Hint: HAXM is required ).
