# Run android errors

**URL:** <https://forum.ionicframework.com/t/run-android-errors/25128>\
**Category:** ionic-v1\
**Created:** [May 20, 2015, 7:06am UTC](https://forum.ionicframework.com/t/run-android-errors/25128 "2015-05-20T07:06:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![aguerra14](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aguerra14](https://forum.ionicframework.com/u/aguerra14)\
**Post date:** [May 20, 2015, 7:06am UTC](https://forum.ionicframework.com/t/run-android-errors/25128/1 "2015-05-20T07:06:17Z")

</div>

So, I’m simply trying to run my app on a plugged in HTC Desire. The steps I’ve taken are: enabling debugging in the manifest xml, enabled usb debugging on the device itself, and created the AVD with a custom definition in the android AVD manager.

The errors I’m getting after running `ionic run android --info`

“Could not create the Java Virtual Machine”  
“Could not reserve enough space for object heap”, as well as the warning  
“No target specified, deploying device [random device number that i have no clue where it’s coming from]”

Here’s an image of my command window:

 ![image](https://global.discourse-cdn.com/ionicframework/original/2X/a/a7518862f7129807f9e4fed99d14eef11b7ca41e.PNG)

Any ideas why i might have this warning and error messages? Are they related issues? or are they two seperate issues?

Thanks in advance! 🙂

---

<div class="post-metadata">

**Author:** ![encodedmirko](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/encodedmirko/32/84116_2.png) [@encodedmirko](https://forum.ionicframework.com/u/encodedmirko)\
**Post date:** [May 20, 2015, 9:11am UTC](https://forum.ionicframework.com/t/run-android-errors/25128/2 "2015-05-20T09:11:06Z")

</div>

The warning is harmless. To fix the error increase the amount of memory for the JVM. See:

[https://code.google.com/p/android/issues/detail?id=75060#c11](https://code.google.com/p/android/issues/detail?id=75060#c11)

---

<div class="post-metadata">

**Author:** ![matheusbsilva](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/matheusbsilva/32/12486_2.png) [@matheusbsilva](https://forum.ionicframework.com/u/matheusbsilva)\
**Post date:** [June 2, 2015, 3:04pm UTC](https://forum.ionicframework.com/t/run-android-errors/25128/3 "2015-06-02T15:04:24Z")

</div>

I got the same error trying to run the build for the “getting started” example.

To fix, I created the file **gradle.properties** in the user home (C:\Users\username\.gradle or ~\.gradle) and set the jvm options:

```
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m

```

**Note:** For Windows, 1024m is maybe too much. I had to set to 512m (even having 8GB of total memory).

---

<div class="post-metadata">

**Author:** ![aguerra14](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aguerra14](https://forum.ionicframework.com/u/aguerra14)\
**Post date:** [June 8, 2015, 3:02am UTC](https://forum.ionicframework.com/t/run-android-errors/25128/4 "2015-06-08T03:02:08Z")

</div>

Yes, that worked. thanks!

---

<div class="post-metadata">

**Author:** ![Ndoradoumngue](https://avatars.discourse-cdn.com/v4/letter/n/b9bd4f/32.png) [@Ndoradoumngue](https://forum.ionicframework.com/u/Ndoradoumngue)\
**Post date:** [October 28, 2015, 6:06pm UTC](https://forum.ionicframework.com/t/run-android-errors/25128/5 "2015-10-28T18:06:40Z")

</div>

Oh yes!.. Bravoo… I was almost uninstalling everything and giving up ionic! This solved my problem and gave me strength to kick going. 😉  
Merci, beaucoup! 😄

---

<div class="post-metadata">

**Author:** ![CodeAbuser](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@CodeAbuser](https://forum.ionicframework.com/u/CodeAbuser)\
**Post date:** [August 4, 2016, 6:14pm UTC](https://forum.ionicframework.com/t/run-android-errors/25128/6 "2016-08-04T18:14:28Z")

</div>

worked for me too! thanks. not sure why this error started happening all of the sudden. i’ve been building with ‘ionic run android’ for months now and this just started erroring. anyways, thanks!

---

<div class="post-metadata">

**Author:** ![amitasaurus](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amitasaurus](https://forum.ionicframework.com/u/amitasaurus)\
**Post date:** [November 2, 2016, 4:31pm UTC](https://forum.ionicframework.com/t/run-android-errors/25128/7 "2016-11-02T16:31:07Z")

</div>

I was having the same problem and i added **org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m** to my gradle.properties . But now i’m having a different problem .  
\> Error occurred during initialization of VM

> ```
> Could not reserve enough space for 2097152KB object heap
> 
> ```

---

<div class="post-metadata">

**Author:** ![bharat\_mungarh](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bharat_mungarh/32/101473_2.png) [@bharat\_mungarh](https://forum.ionicframework.com/u/bharat_mungarh)\
**Post date:** [November 29, 2016, 4:19am UTC](https://forum.ionicframework.com/t/run-android-errors/25128/8 "2016-11-29T04:19:48Z")

</div>

If you are using windows then follow this:

Go to Start → Control Panel → System → Advanced system settings → advanced(tab) → Environment Variables → System Variables → New:

Variable name:\_ JAVA\_OPTIONS (there is no space between \_ and JAVA\_OPTIONS, but the editor is not letting me do so… ☹ )  
Variable value: -Xmx512M

I hope this will solve problem, 🙂

---

<div class="post-metadata">

**Author:** ![maqeelqureshi](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@maqeelqureshi](https://forum.ionicframework.com/u/maqeelqureshi)\
**Post date:** [January 13, 2017, 1:29pm UTC](https://forum.ionicframework.com/t/run-android-errors/25128/9 "2017-01-13T13:29:32Z")

</div>

Thanks, issue solved

---

<div class="post-metadata">

**Author:** ![Airjure](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/airjure/32/106483_2.png) [@Airjure](https://forum.ionicframework.com/u/Airjure)\
**Post date:** [January 31, 2017, 8:49am UTC](https://forum.ionicframework.com/t/run-android-errors/25128/11 "2017-01-31T08:49:13Z")

</div>

Thanks @bharat_mungarh, this solved my problem perfectly!
