• Register
+1 vote


I am getting this error when I tried to build shadow demo for android:

Building DEX Failed!
G:\Unity\JavaPluginSample\Temp/StagingArea> java -Xmx1024M
-jar "G:/AndroidSDK/android-sdk_r09-windows\platform-tools/lib/dx.jar"
--dex --verbose --output=bin/classes.dex bin/classes.jar plugins
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Can anybody help to fix or explain me this error

ago by (2.6k points)  

1 Answer

+2 votes


This is usually caused by a bad version of Java being installed on your machine.
Try updating your Java install to the latest version and this will generally solve this issue.

or you can try it :

Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M
Variable name: Path
Variable value: ;C:\Program Files\Java\jre6\bin;F:\JDK\bin;
Change this to your appropriate path.


ago by (4.5k points)