Build Errors?

Monkey Targets Forums/Android/Build Errors?

Amon(Posted 2012) [#1]
C:\Apps\Coding\Monkey_Targets\android-sdk-windows\tools\ant\build.xml:818: The following error occurred while executing this line:
C:\Apps\Coding\Monkey_Targets\android-sdk-windows\tools\ant\build.xml:820: The following error occurred while executing this line:
C:\Apps\Coding\Monkey_Targets\android-sdk-windows\tools\ant\build.xml:832: The following error occurred while executing this line:
C:\Apps\Coding\Monkey_Targets\android-sdk-windows\tools\ant\build.xml:278: null returned: 1


   [dx] Error: Could not create the Java Virtual Machine.
       [dx] Error: A fatal exception has occurred. Program will exit.
       [dx] Error occurred during initialization of VM
       [dx] Could not reserve enough space for object heap


I updated the android sdk and now get the above build errors. Can anybody shed some light to get it working again?


AndroidAndy(Posted 2012) [#2]
@Amon - Did you check the JAVA_HOME environment variable to make sure it is still pointing to the correct jdk folder?


Amon(Posted 2012) [#3]
After hunting for a solution I found one. in the android sdk platform tools folder edit dx.bat and change the following:

REM By default, give dx a max heap size of 1 gig and a stack size of 1meg.
rem This can be overridden by using "-JXmx..." and "-JXss..." options below.
set defaultXmx=-Xmx512M


Mine was set to 1024M. Changing it to 512M fixes the problem for me.


AndroidAndy(Posted 2012) [#4]
@Amon - Good to know!


Amon(Posted 2012) [#5]
Sorry Andy I didn't see your post. Yep I did make sure the path was pointing to the correct folder. Found a solution though.