Error 'ionic run Android' on device

2019-02-04 23:36发布

问题:

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:

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

回答1:

This worked for me

Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System Variables->New:

Variable name: _JAVA_OPTIONS

Variable value: -Xmx512M



回答2:

Add _JAVA_OPTIONS to your Environment Variables with the value -Xms512M



回答3:

Try deleting your .gradle from C:\Users\ directory and try again.