Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Building DEX Failed!

Discussion in 'Editor & General Support' started by psrussell, Nov 16, 2012.

  1. psrussell

    psrussell

    Joined:
    Feb 4, 2012
    Posts:
    8
    I just purchased and imported GyroDroid into a new Unity 3.5.6f4 project on a WinXP SP3 machine. I have the latest JRE6 is up to date. When I try to build the project for Android, I get the following error:

    Failed to compile Java code to DEX:
    C:\UnityDevelopment\GyroDroid\Temp/StagingArea> java -Xmx1024M -Djava.ext.dirs="C:/Program Files/Android/android-sdk-windows\platform-tools/lib/" -jar "C:/Program Files/Android/android-sdk-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.

    When I try the fix referenced in this thresd:

    http://forum.unity3d.com/threads/88119-Could-not-reserve-enough-space-for-object-heap-RESOLVED

    by creating a _JAVA_OPTIONS env var using a value of -Xmx512m the compile appears to work, but then errors when trying to sign the package, even though the correct passwords in the publishing settings.

    arsigner: unable to read password: The handle is invalid
    Enter Passphrase for keystore: Picked up _JAVA_OPTIONS: -Xmx512m

    UnityEngine.Debug:LogError(Object)
    PostProcessAndroidPlayer:SignAndroidPackage(String) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/BuildPipeline/PostProcessAndroidPlayer.cs:949)
    PostProcessAndroidPlayer:postProcess(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/BuildPipeline/PostProcessAndroidPlayer.cs:460)
    UnityEditor.HostView:OnGUI()

    Any ideas or suggestions?

    Thanks