Thank you for submitting your inquiry.
You can track the status of your inquiry here.
You may want to save your case's ticket: 589882_4417a1cnfve5rd9s


    (Closed) Getting an ArgumentException when building a project for
     
     
     
    4
    1) What happened

    Getting an ArgumentException when building a project for Android

    Stack trace attached

    2) How can we reproduce it using the example you attached

    1. Set up an environment variable _JAVA_OPTIONS with a value -Xmx8192M

    2. Run an android bulid (restart unity if it was running before setting a new env var)

    3. Bulid fails on ArgumentException

    As part of the bulid, Unty runs this command (paths vary between machine):

    "C:\Program Files\Java\jdk1.7.0_17\bin\java.exe" -Xmx1024M -Dcom.android.sdkmanager.toolsdir="D:\Android\sdk\tools" -Dfile.encoding=UTF8 -jar "D:\Unity_45\Editor\Data\BuildTargetTools\AndroidPlayer\sdktools.jar" -

    Its output, in case the _JAVA_OPTIONS was set is:

    Picked up _JAVA_OPTIONS: -Xmx1024M

    unfortunately, this output is then captured as the command's output stream and somehow assigned to some internal variable that unity uses later on (see the path it tries to combine in the stack trace).
     
       
      To follow up on this case, send email to bugs@unity3d.com mentioning 'Case 589882' in the subject.
      Your Cases:
      Case Title Status Date Opened
      793723 Profiler graph become black after destroying RawImage.mainTexture Open 5/3/2016 8:27 AM
      793702 Editor crashes when destroying RawImage.mainTexture Open 5/3/2016 6:08 AM
      793235 WWW downloads hang in case too many are started concurrently Closed 5/1/2016 6:29 AM
      791273 AssetBundle.name is empty Open 4/24/2016 3:07 PM
      787419 Editor crashed while opening a project Open 4/10/2016 9:07 PM
      787406 WebGL PlayerSettings "Run in Background" affects Android editor behaviour Closed 4/10/2016 7:58 PM
      786142 Endless object reference loops in profiler "referenced by" window Closed 4/6/2016 6:18 AM
      785671 Error when loading profiler data file using Profiler.AddFramesFromFile Closed 4/4/2016 9:19 PM
      785491 Failing to download FB images on WebGL in Safari Closed 4/4/2016 9:46 AM
      783703 Deadlock when quitting game on iOS Closed 3/29/2016 10:27 AM
      781657 Built .apk contains UnityEngine.dll.mdb Open 3/21/2016 7:48 PM
      776595 Profiler shows wrong data when using Begin/EndSample in deep profile mode Open 3/3/2016 6:58 PM
      771396 Profiler shows texture uses twice the amount of memory Open 2/17/2016 6:38 AM
      770015 Compilation error when defining a coroutine with try..catch and not using exception object Closed 2/11/2016 11:24 PM
      769072 Internal profiler in iOS doesn't show scripting memory information Open 2/9/2016 12:26 PM
      768572 Xcode build fails on duplicate symbols (PLCrashReporter Closed 2/7/2016 6:49 PM
      762033 Error message when dragging a sprite to scene Closed 1/15/2016 9:59 PM
      758274 Can create an animation event at negative time Closed 12/31/2015 12:49 PM
      756736 UnityEditor.iOS.Extensions.Xcode.dll not added to project as reference Open 12/23/2015 5:39 PM
      754932 Update documentation for AssetModificationProcessor Open 12/17/2015 6:27 AM
      750227 Game doesn't open on Android 6 (Marshmallow) devices Closed 12/3/2015 11:30 PM
      746490 Debug.Log extracts stack trace when settings StackTraceLogType.None Closed 11/21/2015 6:49 AM
      743296 Profiler rounding issues Open 11/9/2015 9:59 PM
      742859 Profiler doesn't list object names/types Open 11/7/2015 7:51 PM
      741735 PlayerPrefs.GetString doesn't return default value in case key is not found Open 11/3/2015 8:04 PM
      740023 Android build crashes in development mode Closed 10/27/2015 9:58 PM
      738249 ArgumentCache.TidyAssemblyTypeName allocates lots of memory Closed 10/21/2015 5:09 PM
      738159 Draw Calls column in profiler moves between profiler frames Open 10/21/2015 9:10 AM
      737576 The editor crashes when entering play mode Closed 10/19/2015 6:59 PM
      733842 IndexOutOfRangeException when building for Android Closed 10/6/2015 11:19 AM
      733728 Error when adding component: OPENGL ERROR (ApiGLES::ActiveTextureUnit Closed 10/5/2015 8:10 PM
      733430 TLS Allocator errors in playmode Closed 10/4/2015 4:59 PM
      729282 Android library not recognized outside of Assets/Plugins/Android Closed 9/21/2015 7:18 PM
      728988 DLLs marked as "editor" in plugin inspector are included in build Open 9/20/2015 9:49 AM
      728934 Confusing "Open" button in the editor launcher Closed 9/19/2015 10:29 PM
      723950 yield return www hangs when there's no connectivity Closed 8/31/2015 3:59 PM
      720900 Build includes an unreferenced file (after breaking prefab connection Closed 8/18/2015 9:59 PM
      720207 iOS IL2CPP build includes UnityEngine.xml in .ipa Closed 8/16/2015 11:58 AM
      718042 Dynamically created texture is not unloaded from memory Open 8/6/2015 8:49 PM
      714344 Errors when importing iOS .framework libraries Open 7/23/2015 3:09 PM
      710263 MonoDevelop halts on open if file has a long text line in it Open 7/7/2015 4:29 PM
      707037 OnApplicationPause(true) not called in editor Open 6/24/2015 8:38 AM
      707036 OnApplicationQuit is called before OnDestroy Open 6/24/2015 8:38 AM
      704740 Inconsistent data loaded from InitializeOnLoad and InitializeOnLoadMethod methods Open 6/15/2015 3:59 PM
      704069 IL2CPP (iOS) build fails when removing scripts between builds without restarting editor Closed 6/11/2015 11:49 PM
      703070 [PostProcessScene] runs for disabled scenes Open 6/10/2015 12:12 AM
      701635 Fail to build for android after upgrading android SDK from SDK manager Open 6/3/2015 11:19 AM
      701451 Build includes deselected Android library (manifest merge fails Closed 6/2/2015 5:30 PM
      700190 A$ Submission 36930: Code Templates Closed 5/28/2015 12:03 AM
      699666 Unity Multiplayer - Command code generation issue with delegates Open 5/27/2015 7:39 AM
      699613 SyncVars are limited to 32 per NetworkBehaviour Closed 5/27/2015 12:10 AM
      699585 Exceptions in editor after importing new assets Open 5/26/2015 9:29 PM
      698401 UNet: component's inspector doesn't save expanded/collapsed state Open 5/21/2015 11:23 AM
      698395 Error dialog not displayed on unsupported Android device Open 5/21/2015 11:23 AM
      698393 Error dialog not displayed on unsupported Android device Open 5/21/2015 11:22 AM
      698342 UNet documentation: Object Spawning (DeSerialize should be OnDeserialize) Open 5/21/2015 11:18 AM
      698338 UNet documentation - typo (managerment) Open 5/21/2015 11:18 AM
      696581 UNet documentation: Object spawning (DoSerialize should be OnDeserialize Closed 5/13/2015 12:18 PM
      696580 Dialog not shown for unsupported android device Closed 5/13/2015 12:18 PM
      696579 UNet: component's inspector doesn't save expanded/collapsed state Closed 5/13/2015 12:18 PM
      696312 UNet documentation: issues on NetworkManager page Closed 5/12/2015 7:45 AM
      696306 UNet documentation: UClientManager should be ClientScene Closed 5/12/2015 7:13 AM
      696206 UNet documentation: text not shown as bullet list Closed 5/11/2015 11:25 PM
      696204 UNet documentation: typos in concepts page Closed 5/11/2015 11:21 PM
      695760 UNet - failing to create room with digits in its name Open 5/9/2015 9:09 AM
      695713 UNet - properties starting with lower case Closed 5/9/2015 12:29 AM
      695708 UNet documentation: using the networkmanager page mentions UMatch Closed 5/8/2015 11:51 PM
      695704 UNet documentation: Remote actions page Closed 5/8/2015 11:16 PM
      695692 UNet documentation issues in Using the NetworkManager page Closed 5/8/2015 10:10 PM
      695690 UNet documentation: broken links on Open 5/8/2015 10:08 PM
      695688 UNet documentation: broken links on "Player Objects" page Open 5/8/2015 10:06 PM
      695685 UNet documentation: missing info in page Closed 5/8/2015 10:01 PM
      695683 UNet documentation: broken links Closed 5/8/2015 9:59 PM
      695681 UNet documentation: typo (featuers) Closed 5/8/2015 9:53 PM
      694365 Type in documentation links to IOS.ADBannerView.Type Open 5/4/2015 11:48 AM
      694354 Scenes in editor build settings cannot be removed from the editor Open 5/4/2015 10:50 AM
      694228 Script debugging can be set without setting development build Open 5/3/2015 1:38 PM
      693318 Cannot set breakpoint properties in MonoDevelop Closed 4/29/2015 3:18 PM
      693234 SyncVar not enforced to strictly primitive types Closed 4/29/2015 8:08 AM
      693186 UNET tanks demo project errors Open 4/28/2015 10:47 PM
      693181 UNet documentation issues Closed 4/28/2015 10:36 PM
      693180 UNet documentation - broken link Closed 4/28/2015 10:30 PM
      693177 UNet documentation - broken link Closed 4/28/2015 10:27 PM
      692737 New project window initially loads blank for few seconds Open 4/27/2015 11:48 PM
      692736 cannot navigate bug reporter using tab / shift-tab Closed 4/27/2015 11:48 PM
      692735 Player Settings window causes errors in the console Closed 4/27/2015 11:39 PM
      692688 Browser throws error for missing function Closed 4/27/2015 8:49 PM
      690562 Export package window cannot be resized Open 4/19/2015 9:49 AM
      689923 Errors when reimporting Android library in Unity 5 Open 4/16/2015 6:09 PM
      689912 Error importing Java plugin that contains hidden files in it Open 4/16/2015 5:29 PM
      689286 Many errors in logcat on unmatch pixel format Closed 4/14/2015 9:59 AM
      689075 Xcode project fails to build IL2CPP compiled project Closed 4/13/2015 4:50 PM
      689064 "AR Mv 7" in Device filter in Android Player Settings Open 4/13/2015 4:09 PM
      688865 Crash when repacking sprite atlases Open 4/12/2015 7:09 PM
      688838 Entered play mode Open 4/12/2015 3:19 PM
      687038 ArgumentOutOfRangeException when reimporting assets in editor Open 4/6/2015 2:59 PM
      686988 Error in XCode when building exported Unity project Open 4/6/2015 9:08 AM
      686986 BundleIdentifier name in PlayerSettings for iOS Open 4/6/2015 8:49 AM
      686052 Physics2D.CircleCastAll doesn't return all hits Closed 4/2/2015 9:09 AM
      685780 BuildPipeline.BuildPlayer changes the currently selected build target Open 4/1/2015 4:29 PM
      685352 Typo in WebGL docs Closed 3/31/2015 10:09 AM
      685344 WebGL docs page "early access Closed 3/31/2015 9:09 AM
      685343 WebGL docs page typo Closed 3/31/2015 9:09 AM
      684902 WWW class in WebGL blocks indefinitely when there's no internet connection Closed 3/29/2015 5:49 PM
      683842 OnHeaderGUI for custom inspector never gets called Open 3/25/2015 10:29 PM
      683368 AudioSource.mute doesn't have any effect in WebGL builds Closed 3/24/2015 5:27 PM
      682750 The editor crashes while building for WebGL Open 3/22/2015 10:19 AM
      681024 Documentation for Application.logMessageReceived Open 3/16/2015 11:59 AM
      681013 Importing the given package crashes the editor Open 3/16/2015 11:09 AM
      680978 OnLevelWasLoaded not shown in MonoBehaviour event order page Open 3/16/2015 6:49 AM
      680184 Editor assembly not imported properly Open 3/13/2015 7:22 AM
      679537 Compilation error in MonoDevelop but Unity does not throw an error when compiling Open 3/11/2015 5:49 PM
      679511 Error when displaying PlayerSettings in debug mode Open 3/11/2015 4:29 PM
      675618 Built a project for iOS Open 2/26/2015 11:49 AM
      675611 Our game consistently crashes on iOS with 4.6.2 Closed 2/26/2015 11:29 AM
      675327 JNI call with AndroidJavaProxy[] fails to create signature Open 2/25/2015 3:00 PM
      674561 The editor crashed while updating scripts Open 2/22/2015 10:48 PM
      674365 Typo in asset store package import compatibility message Closed 2/21/2015 7:59 PM
      672726 Debug.Log doesn't work from Application.RegisterLogCallback context Open 2/16/2015 1:59 PM
      672479 Editor crash after changing asset serialization to Force Text Closed 2/15/2015 7:59 AM
      668785 No mention of the new IL2CPP scripting backend in the docs Closed 2/1/2015 1:49 PM
      668503 Inconsistent behaviour between AssetDatabase.FindAssets and Open 1/31/2015 12:19 AM
      668496 No documentation for AssetDatabase.GetAllAssetPaths Open 1/30/2015 11:59 PM
      667260 Quitting game on Android and relaunching quickly causes ANR Open 1/27/2015 2:59 PM
      665782 CompilationOrderFolders page - typo Open 1/22/2015 8:59 PM
      664416 Compiler error when invoking method with named parameters Open 1/18/2015 11:29 AM
      662485 Xcode manipulation API in U5 is not documented Open 1/12/2015 9:18 AM
      662059 editor crashed Closed 1/10/2015 12:18 AM
      660878 Unity editor crashed on close Open 1/5/2015 3:17 AM
      659691 Typo in particle system tooltip (duration field Closed 12/29/2014 3:49 PM
      658994 Inspector tooltips not shown in play mode Open 12/25/2014 9:44 AM
      657996 Project fails to build for WebGL Closed 12/20/2014 6:29 PM
      655500 il2cpp.exe should report unhandled exceptions to Console. Closed 12/12/2014 1:30 PM
      655494 WebGL build fails due to il2cpp process failing Closed 12/12/2014 1:08 PM
      654337 Profiler doc page does not mention what is "Profile Editor Open 12/8/2014 2:40 PM
      653009 WebGL player settings missing description for "Preloaded Closed 12/3/2014 3:08 PM
      652529 EventTrigger events listed differently than in Intercepted Open 12/2/2014 12:18 AM
      652527 Typo in EventTrigger page Open 12/2/2014 12:18 AM
      651490 Scripting defines docs do not mention UNITY_IOS define Open 11/27/2014 2:19 PM
      651449 GameObject.FindObjectsOfType doesn't return all objects in Open 11/27/2014 11:58 AM
      651353 EditorApplication.playmodeStateChanged raised with no change Closed 11/27/2014 12:49 AM
      651169 [Installer]The documentation is always installed Closed 11/26/2014 12:09 PM
      651168 [Installer]Clicking the title of each component toggles it Closed 11/26/2014 12:09 PM
      651147 WebGL fails with exception from IL2CPP Closed 11/26/2014 9:39 AM
      650883 Unity Download Assistant issues Closed 11/25/2014 11:09 AM
      650228 Inconsistency between adding a UI game object from Open 11/23/2014 12:39 AM
      650136 Editor crashed when clicking play Open 11/22/2014 3:19 PM
      650120 Exception when creating a Button inside another game object Open 11/22/2014 12:49 PM
      649267 Crash in Unity code on iOS Open 11/19/2014 3:57 PM
      648765 iOS plugins page should mention MonoPInvokeAttribute Open 11/17/2014 11:29 PM
      648743 Documentation issue in AssetDatabase.FindAssets Closed 11/17/2014 9:39 PM
      648030 UnityEngine.dll contains JetBrains.Annotations framework Open 11/14/2014 7:49 PM
      648026 AssetDatabase.GetAllAssetPaths() returns some irrelevant Open 11/14/2014 7:29 PM
      645484 Accessing destroyed object on Android throws a Open 11/5/2014 11:10 AM
      642054 Scale is (0, 0, 0) when duplicating object with parent scale Open 10/23/2014 9:30 AM
      641871 Blank (white) screen when returning from lock screen on Open 10/22/2014 4:29 PM
      641866 Clicked on screen repeatedly Open 10/22/2014 4:19 PM
      641330 Unity was reimporting assets after i switched a git branch Open 10/20/2014 5:19 PM
      640880 Load prev project under Preferences is cut off Open 10/18/2014 12:49 PM
      639359 White screen when returning to game after orientation Open 10/12/2014 3:59 PM
      638020 Issue in Profiling documentation page Open 10/7/2014 8:18 PM
      637975 Asset store release notes link does not open correctly Open 10/7/2014 4:48 PM
      637921 Sprite references are broken Open 10/7/2014 1:57 PM
      637255 Links under "Serialization" are broken Closed 10/3/2014 8:38 PM
      636927 Getting an error on iOS when using NotificationServices Open 10/2/2014 1:18 PM
      636885 documentation for ShowDefaultAchievementCompletionBanner - Open 10/2/2014 8:09 AM
      633983 added animation event says "function not supported Open 9/17/2014 6:07 PM
      630375 Select Dependencies returns wrong results Open 9/1/2014 11:58 AM
      628812 Package import does not import files to the correct location Open 8/26/2014 10:49 AM
      625478 Can't get selected folder using Selection class Open 8/11/2014 2:38 PM
      624902 Crash while running game in editor after attaching Xamarin Open 8/8/2014 9:49 AM
      623621 Documentation issue Open 8/1/2014 5:52 PM
      623564 UI section missing from center of documentation index page Closed 8/1/2014 12:50 PM
      622799 Adding a new script through Add Component adds the script Closed 7/29/2014 8:09 AM
      619586 Compiler error CS0121 (ambiguous call) for the attached Open 7/14/2014 10:50 PM
      619329 OnLevelWasLoaded not called for LoadAdditive overloads Open 7/13/2014 11:49 AM
      617465 Entered GetComponents<MapLevel Open 7/3/2014 1:49 PM
      617046 Exported to android using Build and run Closed 7/1/2014 4:38 PM
      617045 I was building a project for android Closed 7/1/2014 4:38 PM
      616836 Error building apk for android with latest version of Closed 6/30/2014 5:50 PM
      615002 NullReferenceException when clicking on "Open Publishing Closed 6/20/2014 11:58 PM
      614007 When editing a prefab, the "Apply" button should be Open 6/16/2014 3:00 PM
      613110 Prefabs are only saved when saving project Open 6/11/2014 2:19 PM
      611954 Sprite with max size 2048 causes an error Closed 6/5/2014 1:50 PM
      608948 Cannot rebuild exported VS2013 WindowsStore project twice Closed 5/21/2014 8:59 AM
      608646 Cant select field in Assertion Component Closed 5/19/2014 6:58 PM
      607663 Exception if editor attempts to find android sdk path in Closed 5/13/2014 6:08 PM
      606835 Import package window allows reimporting existing assets Closed 5/8/2014 9:49 PM
      606745 Inconsistent import package window behavior Open 5/8/2014 3:31 PM
      606154 Importing a package using AssetDatabase.ImportPackage fails Closed 5/5/2014 11:29 AM
      603421 Cannot call set_Enabled from UnityEvent in the inspector Closed 4/19/2014 10:59 PM
      603419 UnityEvent dropdown shows setter properties in the function Closed 4/19/2014 10:49 PM
      600304 iOS build fails when building Development Build + Script Open 4/3/2014 9:30 AM
      600169 Getting a build error when building for iOS after building Closed 4/2/2014 3:49 PM
      597513 1. Added a .dll under Assets/Plugins Open 3/18/2014 10:28 PM
      597512 I'm trying to use the new "Plugin Inspector" feature Closed 3/18/2014 10:18 PM
      597431 New "Welcome" screen doesnt show a scroll bar in the package Closed 3/18/2014 1:09 PM
      597430 Poor wording for error message regarding script Closed 3/18/2014 1:09 PM
      592455 Typo Closed 2/20/2014 10:41 AM
      592366 1. I was using Unity in the office Closed 2/19/2014 10:09 PM
      589882 Getting an ArgumentException when building a project for Closed 2/6/2014 10:49 PM
      583840 Generic UnityEvent<T> not shown in editor - cannot hook Closed 1/3/2014 10:48 AM
      583839 Documentation for UnityEvent (generic versions of it) for C Closed 1/3/2014 10:48 AM
      583240 T4 templates that are added in MonoDevelop to the project ( Closed 12/28/2013 11:09 PM
      581247 A$ Submission 83023: WinRT Component Importer Open 12/15/2013 12:31 AM
      580748 Intercepted Events section in the inspector - can add "tags Closed 12/11/2013 11:54 PM
      575013 Tried to open the angry bots project Open 11/12/2013 10:14 PM
      555197 Ran an editor extension i am creating Closed 8/2/2013 12:34 PM
      541093 I have a Plugins folder, under it i have 2 variations of a Closed 5/6/2013 7:19 PM
      538527 user submitted bug Closed 4/20/2013 10:01 AM
      537389 MonoDevelop doesn't open files that are in a git repository Closed 4/13/2013 3:11 PM
      516420 dont know Closed 1/20/2013 11:03 PM