Search Unity

2018.2.0f2 Consistently Crashes on Build

Discussion in 'Editor & General Support' started by mlaibow, Jul 22, 2018.

  1. mlaibow

    mlaibow

    Joined:
    Feb 5, 2014
    Posts:
    40
    I updated to 2018.2.0f2 and was able to run my project in the editor.
    However, when I attempt to build an executable, target platform is Standalone PC/Windows, one of two things happens, either the unity editor crashes and disappears or it just hangs.

    The project was building fine before I updated.
    So I created a new project in 2018.2 and added just the bare minimum of my project, and same thing.
    I have also tried various options for .NET versions.

    I believe it crashes with the Stack Overflow error I have below. The logging stops when it crashes or hangs, but sometimes it gets this error in to the log before it does that. And sometimes the log is filled with Allocation of 16 bytes at [Memory Address].

    I have tried reimporting, restarting, rebooting, removing packages, removing assets, etc, with no luck.
    I did a complete uninstall including cleaning out the registry and I am trying to rollback the unity version until I can get it to build, but that is taking awhile.

    If anyone has any idea what is wrong with my ability to build an executable or has seen the error below, I would appreciate any help.
    It crashes before it really gives me any information.

    Thanks!
    -mat

    StackOverflowException: The requested operation caused a stack overflow.
    at (wrapper managed-to-native) UnityEditor.BuildPipeline.BuildPlayerInternalNoCheck(string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool)
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x0019a] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:170
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94
    at UnityEditor.BuildPlayerWindow.GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension buildWindowExtension, System.Boolean enableBuildButton, System.Boolean enableBuildAndRunButton, System.Boolean canInstallInBuildFolder, UnityEditor.Build.BuildPlatform platform) [0x0018c] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:891
    at UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () [0x0091b] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:816
    at UnityEditor.BuildPlayerWindow.OnGUI () [0x00191] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:414
    at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <f826c2584fc94ec19a48a6576640bdc5>:0
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <f826c2584fc94ec19a48a6576640bdc5>:0
    at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <f826c2584fc94ec19a48a6576640bdc5>:0
    at UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) [0x00013] in C:\buildslave\unity\build\Editor\Mono\HostView.cs:295
    at UnityEditor.HostView.Invoke (System.String methodName) [0x00009] in C:\buildslave\unity\build\Editor\Mono\HostView.cs:288
    at UnityEditor.HostView.OldOnGUI () [0x00078] in C:\buildslave\unity\build\Editor\Mono\HostView.cs:104
    at UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, System.Boolean isComputingLayout) [0x001cc] in C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:237
    at UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) [0x0002f] in C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:380
    at UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) [0x00082] in C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:359
    at UnityEngine.Experimental.UIElements.EventDispatcher.DispatchEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) [0x001fd] in C:\buildslave\unity\build\Modules\UIElements\EventDispatcher.cs:260
    at UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) [0x00065] in C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:243
    at UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) [0x00030] in C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:74
    at UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) [0x00012] in C:\buildslave\unity\build\Modules\IMGUI\GUIUtility.cs:171
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  3. mlaibow

    mlaibow

    Joined:
    Feb 5, 2014
    Posts:
    40
    I submitted the bug as well as posting here.

    However, in the 6 hours or so it took for the bug reporter to actually upload the project and everything, I may have figured it out.

    By changing the name of my Resources folder to My_Resources, and then rebooting and reimporting, I am able to build the project.
    This makes some kind of sense since the Resources folder is handled differently by the build process than by the editor debugger.
    As far as what specifically in the Resources folder was crashing the build, I have not pinpointed it yet. As far as I know, I was using the Resources folder correctly and I only had prefabs, graphic assets, and sound files in it.

    I may incrementally move files back into the Resources folder to see which one breaks it.
     
    Peter77 likes this.
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    This reminds me, there might pop up issues if the size of all assets in any Resources directory goes over 4gb combined:
    https://forum.unity.com/threads/bug-4gb-limit-to-textures-in-standalone-build.441116/

    If this is the case, the short answer to this is to switch from Resources to multiple AssetBundle's to by-pass this limitation.

    In either case, still a bug in Unity. The editor should never crash, so submitting a bug-report for useful.
     
  5. llagach

    llagach

    Joined:
    Jul 1, 2015
    Posts:
    3
    I got exactly the same bug in unity 2019.4.26 LTS, have you discovered more things about it ? You seem to be the only one on internet to have the same error log. Do you remember what was your exact process to debug it ?
     
    Last edited: May 26, 2021
  6. themorfeus

    themorfeus

    Joined:
    Jun 14, 2013
    Posts:
    10
    Same issue! Unity 2019.4.24f1.
    I'd love to know if you have a repro or a solution for this issue - or at least an issue tracker page I could upvote.

    As for details on my side: We have some complex scriptable objects with sub assets (ussing AddObjectToAsset) that crash the build. We've pinpointed it to 4 assets that are problematic, but have not had any luck with finding out what exactly makes them crash the build.
     
  7. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437

    i see in other thread that a unity bot just deletes bug reports when summited before 2019.4 now ?
    is this true
     
    Thygrrr likes this.