Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2019.4.X, 2020.1.X, 2020.2.X

Votes

58

Found in

2020.1

2020.2

Issue ID

1275270

Regression

Yes

[window layout] cannot load editor layout, stuck in infinite loop of "failed to load window layout"

Window management

-

steps to repro:
1a. copy the attached "corrupted" LastLayout.dwlt into ~/Library/Preferences/Unity/Editor-5.x/Layouts/default/ (or win/linux equivalent directory)
1b. create a new project via Unity hub

Expected: project is created and opens (and... revert factory settings / load default layout buttons fix the issue and Unity opens)
Actual: project is created but then a dialog appears and user is stuck in infinite loop that can only be stopped by selecting "quit"

repro: 2020.2.0a21, 2020.1.5f1
no repro: 2019.4.6f1

Note:
- found on MacOS
- "Failed to load window layout" window causes user to be caught in an infinite loop since nothing fixes the issue so the window will stay
- 2019.4.6f1 can successfully open with the "corrupted" LastLayout.dwlt but does show console errors

Workaround:
- try moving or deleting the files at
- ~/Library/Preferences/Unity/Editor-5.x/Layouts/default/LastLayout.dwlt (or equivalent path)
- <PROJECT>/Library/CurrentLayout-default.dwlt

  1. Response avatar

    Resolution Note (fix version 2021.1):

    You can resolve this issue by upgrading to the appropriate fixed version:
    - 2021.1.0a5
    - 2020.2.0b12
    - 2020.1.14f1

    What has changed?
    - “Failed to load window layout” popup dialog now displays the error that occurred when loading the layout.
    - Choosing “quit” will remove the broken layout from the cache.
    - Choosing “Load default layout” or “revert factory settings” no longer results in an infinite loop with “Failed to load window layout”
- A console error will indicate why Unity failed to load the window layout - this can be cleared.

  2. Response avatar

    Resolution Note (fix version 2020.2):

    Tested fixed in 2020.2.0b12

    Unity no longer creates an infinite loop of popup dialogs when attempting to load an invalid or corrupted layout.

  3. Response avatar

    Resolution Note (fix version 2020.1):

    Tested fixed in 2020.1.14f1

    Unity no longer creates an infinite loop of popup dialogs when attempting to load an invalid or corrupted layout.

Comments (43)

  1. 8a0accb308489e77827f73dd7c446ff1?d=mm

    erkneren

    Oct 20, 2020 11:02

    Still getting this
    NullReferenceException: Object reference not set to an instance of an object
    at UnityEditor.UIElements.UIElementsEditorUtility..cctor () [0x0003d] in <9ddd600ae5964fe0b21a870e08c53748>:0
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
    at UnityEditor.SceneView.CreateCameraRectVisualElement () [0x00048] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SceneView.OnEnable () [0x00368] in <9ddd600ae5964fe0b21a870e08c53748>:0
    UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:RevertFactorySettings(Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:RevertFactorySettings(Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    UnityEditor.WindowLayout:LoadDefaultLayout()
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    UnityEditor.WindowLayout:LoadDefaultLayout()
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    UnityEditor.WindowLayout:LoadDefaultLayout()
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:LoadDefaultWindowPreferences()

    (Filename: <9ddd600ae5964fe0b21a870e08c53748> Line: 0)

    Failed to load window layout: System.TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
    at UnityEditor.UIElements.UIElementsEditorUtility..cctor () [0x0003d] in <9ddd600ae5964fe0b21a870e08c53748>:0
    --- End of inner exception stack trace ---
    at UnityEditor.EditorToolbar.CreateRoot () [0x00045] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.EditorToolbar.get_rootVisualElement () [0x00017] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.Toolbar.PositionChanged (UnityEditor.GUIView view) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.GUIView.SetPosition (UnityEngine.Rect newPos) [0x00058] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.MainView.SetPosition (UnityEngine.Rect newPos) [0x0007f] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.ContainerWindow.set_rootView (UnityEditor.View value) [0x00050] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.WindowLayout.LoadWindowLayout (System.String path, System.Boolean newProjectLayoutWasCreated, System.Boolean setLastLoadedLayoutName, System.Boolean keepMainWindow) [0x002ec] in <9ddd600ae5964fe0b21a870e08c53748>:0
    UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:RevertFactorySettings(Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:RevertFactorySettings(Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    UnityEditor.WindowLayout:LoadDefaultLayout()
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    UnityEditor.WindowLayout:LoadDefaultLayout()
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    UnityEditor.WindowLayout:LoadDefaultLayout()
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:LoadDefaultWindowPreferences()

    (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

    [LAYOUT] About to save layout C:\Projects\wkspaces\Headhunter_Unity\Library/CurrentLayout-default.dwlt
    [LAYOUT] About to save layout C:/Users/Petter/AppData/Roaming/Unity/Editor-5.x/Preferences\Layouts\default\LastLayout.dwlt

  2. 8a0accb308489e77827f73dd7c446ff1?d=mm

    erkneren

    Oct 15, 2020 07:15

    Seems .8 on Windows helps a bit but it's still there for some.

    NullReferenceException: Object reference not set to an instance of an object
    at UnityEditor.UIElements.UIElementsEditorUtility..cctor () [0x0003d] in <9ddd600ae5964fe0b21a870e08c53748>:0
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
    at UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () [0x00045] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) [0x00011] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.EditorWindow.get_rootVisualElement () [0x00000] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.PropertyEditor.LoadVisualTreeFromUxml () [0x00011] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.InspectorWindow.OnEnable () [0x0000f] in <9ddd600ae5964fe0b21a870e08c53748>:0
    UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:LoadDefaultWindowPreferences()

    (Filename: <9ddd600ae5964fe0b21a870e08c53748> Line: 0)

    NullReferenceException: Object reference not set to an instance of an object
    at UnityEditor.UIElements.UIElementsEditorUtility..cctor () [0x0003d] in <9ddd600ae5964fe0b21a870e08c53748>:0
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
    at UnityEditor.EditorToolbar.CreateRoot () [0x00045] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.EditorToolbar.get_rootVisualElement () [0x00017] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.Toolbar.PositionChanged (UnityEditor.GUIView view) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.GUIView.SetPosition (UnityEngine.Rect newPos) [0x00058] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.HostView.SetPosition (UnityEngine.Rect newPos) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.PlaceView (System.Int32 i, System.Single pos, System.Single size) [0x000a1] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetupRectsFromSplitter () [0x000d8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.Reflow () [0x00072] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetPosition (UnityEngine.Rect newPos) [0x00009] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.PlaceView (System.Int32 i, System.Single pos, System.Single size) [0x000a1] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetupRectsFromSplitter () [0x000d8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.Reflow () [0x00072] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetPosition (UnityEngine.Rect newPos) [0x00009] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.PlaceView (System.Int32 i, System.Single pos, System.Single size) [0x000a1] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetupRectsFromSplitter () [0x000d8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.Reflow () [0x00072] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetPosition (UnityEngine.Rect newPos) [0x00009] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.MainView.SetPosition (UnityEngine.Rect newPos) [0x000c8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.ContainerWindow.OnResize () [0x00044] in <9ddd600ae5964fe0b21a870e08c53748>:0
    UnityEditor.ContainerWindow:Internal_Show_Injected(Rect&, Int32, Vector2&, Vector2&)
    UnityEditor.ContainerWindow:Internal_Show(Rect, Int32, Vector2, Vector2)
    UnityEditor.ContainerWindow:Show(ShowMode, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:LoadDefaultWindowPreferences()

    (Filename: <9ddd600ae5964fe0b21a870e08c53748> Line: 0)

    Failed to load window layout: System.TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
    at UnityEditor.UIElements.UIElementsEditorUtility..cctor () [0x0003d] in <9ddd600ae5964fe0b21a870e08c53748>:0
    --- End of inner exception stack trace ---
    at UnityEditor.EditorToolbar.CreateRoot () [0x00045] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.EditorToolbar.get_rootVisualElement () [0x00017] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.Toolbar.PositionChanged (UnityEditor.GUIView view) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.GUIView.SetPosition (UnityEngine.Rect newPos) [0x00058] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.HostView.SetPosition (UnityEngine.Rect newPos) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.PlaceView (System.Int32 i, System.Single pos, System.Single size) [0x000a1] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetupRectsFromSplitter () [0x000d8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.Reflow () [0x00072] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetPosition (UnityEngine.Rect newPos) [0x00009] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.PlaceView (System.Int32 i, System.Single pos, System.Single size) [0x000a1] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetupRectsFromSplitter () [0x000d8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.Reflow () [0x00072] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetPosition (UnityEngine.Rect newPos) [0x00009] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.PlaceView (System.Int32 i, System.Single pos, System.Single size) [0x000a1] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetupRectsFromSplitter () [0x000d8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.Reflow () [0x00072] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.SplitView.SetPosition (UnityEngine.Rect newPos) [0x00009] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.MainView.SetPosition (UnityEngine.Rect newPos) [0x000c8] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.View.set_position (UnityEngine.Rect value) [0x00001] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.ContainerWindow.Show (UnityEditor.ShowMode showMode, System.Boolean loadPosition, System.Boolean displayImmediately, System.Boolean setFocus) [0x0011c] in <9ddd600ae5964fe0b21a870e08c53748>:0
    at UnityEditor.WindowLayout.LoadWindowLayout (System.String path, System.Boolean newProjectLayoutWasCreated, System.Boolean setLastLoadedLayoutName, System.Boolean keepMainWindow) [0x003fe] in <9ddd600ae5964fe0b21a870e08c53748>:0
    UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean, Boolean, Boolean)
    UnityEditor.WindowLayout:LoadProjectLayout(Boolean)
    UnityEditor.WindowLayout:LoadCurrentModeLayout(Boolean)
    UnityEditor.WindowLayout:LoadDefaultWindowPreferences()

  3. Eead98f4613ad7f415024cf482044881?d=mm

    RedHermit

    Oct 15, 2020 04:58

    2020.1.9 (released today) resolved this issue for me as well

  4. 589054f09fc23f99d8c298331ba36058?d=mm

    SeekerBear

    Oct 14, 2020 21:42

    Appears to be fixed in 2020.1.9 (released today)

  5. B065970bb393568c8a64ad40dd453bba?d=mm

    Quartermaster47

    Oct 07, 2020 12:25

    I fixed this issue by copy and pasting the CurrentLayout-default.dwlt file from my previous project onto the CurrentLayout-default.dwlt file from a new project. Hope this helps!

    I'm on 2020.1.6f1

  6. 222bf45b106d27aaf1e5dc9eabc236f9?d=mm

    DragonParrot

    Oct 07, 2020 10:36

    I'm also having this issue on Unity 2020.1.6f1. The workaround of manually deleting the layout files works for me, though I admit that it does feel a bit frustrating.

  7. B0b0a05dbf73cbc0c53ff7b58415a2fa?d=mm

    SIPAA

    Oct 06, 2020 12:43

    Still having this problem on Unity Hub 2.4.0 and Unity 2020.1.6f1. Cannot create a new project

  8. 2699114eea3f40fea3a245847aa17909?d=mm

    munozpro

    Oct 05, 2020 09:42

    NOT fixed, As of 10/5/2020

    The copy and paste workaround is only a temporary fix! I would only able to work on my project for an hour until I get errors in the console, and the inspector stays blank.

  9. D91c4dd43c82afd058968a8aa7a8a24d?d=mm

    ZoeDreams

    Oct 04, 2020 16:46

    The easiest way to fix this is to just remove the Last and Current layouts which get locked and wrong permission so they do not get updated when creating a new project with the default layout. Could i suggest just to manually copying over the default template file, instead of trying to update when you trigger a first load import. Thank you.

    just remove these two files, and unity will autogenerate the proper ones when you open the project again.

    <home_dir>/Library/Preferences/Unity/Editor-5.x/Layouts/default/LastLayout.dwlt
    <project_dir>/Library/CurrentLayout-default.dwlt

  10. D91c4dd43c82afd058968a8aa7a8a24d?d=mm

    ZoeDreams

    Oct 04, 2020 16:39

    This is still broken on MacOS 10.15.7 (19H2). using the latest version of UNITY. This is like super easy to fix, wtf?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.