Search Unity

Bug Installing UI Toolkit Preview.14 crashes editor & causes"Failed to load window layout"

Discussion in 'UI Toolkit' started by LudiKha, Feb 20, 2021.

  1. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    Installing UI Toolkit preview.14 crashes the editor, by throwing an error (see below). Restarting the editor will then cause the "Failed to load window layout" error to occur.

    - I'm on Unity 2020.2.5f1.
    - There's an error too in preview.13, but it only appears when I don't have UI Builder installed.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.UIElements.UIElementsEditorUtility.GetCommonLightStyleSheet () (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Editor/UIElementsEditorUtility.cs:68)
    3. UnityEditor.UIElements.UIElementsEditorUtility.AddDefaultEditorStyleSheets (UnityEngine.UIElements.VisualElement ve) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Editor/UIElementsEditorUtility.cs:129)
    4. UnityEditor.EditorUIServiceImpl.AddDefaultEditorStyleSheets (UnityEngine.UIElements.VisualElement ve) (at <206c5ab485654180acff3dea5ab7208e>:0)
    5. UnityEditor.EditorWindow.CreateRoot () (at <22954a70fcec46f29620f943d3d7bf23>:0)
    6. UnityEditor.EditorWindow.get_rootVisualElement () (at <22954a70fcec46f29620f943d3d7bf23>:0)
    7. UnityEditor.UIElements.DefaultEditorWindowBackend.UpdateStyleMargins () (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Editor/WindowBackends/DefaultEditorWindowBackend.cs:87)
    8. UnityEditor.UIElements.DefaultEditorWindowBackend.UnityEditor.IEditorWindowBackend.ViewMarginsChanged () (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Editor/WindowBackends/DefaultEditorWindowBackend.cs:81)
    9. UnityEditor.HostView.UpdateViewMargins (UnityEditor.EditorWindow view) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    10. UnityEditor.HostView.SetActualViewPosition (UnityEngine.Rect newPos) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    11. UnityEditor.DockArea.SetActualViewPosition (UnityEngine.Rect newPos) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    12. UnityEditor.HostView.SetPosition (UnityEngine.Rect newPos) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    13. UnityEditor.View.set_position (UnityEngine.Rect value) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    14. UnityEditor.SplitView.PlaceView (System.Int32 i, System.Single pos, System.Single size) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    15. UnityEditor.SplitView.SetupRectsFromSplitter () (at <22954a70fcec46f29620f943d3d7bf23>:0)
    16. UnityEditor.SplitView.Reflow () (at <22954a70fcec46f29620f943d3d7bf23>:0)
    17. UnityEditor.SplitView.SetPosition (UnityEngine.Rect newPos) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    18. UnityEditor.View.set_position (UnityEngine.Rect value) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    19. UnityEditor.ContainerWindow.OnResize () (at <22954a70fcec46f29620f943d3d7bf23>:0)
    20. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
     

    Attached Files:

    Last edited: Feb 20, 2021
  2. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    Moreover, the following error always is present until I remove/re-add the UIBuilder package:

    Code (CSharp):
    1. Library\PackageCache\com.unity.ui@1.0.0-preview.13\Text\Editor\TextSettingsImporter.cs(28,44): error CS0122: 'TextDelegates' is inaccessible due to its protection level
    2.  
    I would be grateful for a reply as these are serious issues that prevent the use of the editor.
     
  3. lndcobra

    lndcobra

    Joined:
    Jan 28, 2020
    Posts:
    21
    Did anyone ever get a fix for original issue?
     
  4. lndcobra

    lndcobra

    Joined:
    Jan 28, 2020
    Posts:
    21
    For me it was because I had com.unity.ui@1.0.0-preview14 installed with non default font selected (Verdana).

    Had to

    1. Uninstall com.unity.ui packages in "\Packages\manifest.json" and "\Packages\packages-lock.json"
    2. Open editor ignore compilation errors
    3. Change font to default
    4. Reopen editor
    5. Install com.unity.ui package again

    Hope this helps someone!
     
    elitegoliath13 and LudiKha like this.
  5. elitegoliath13

    elitegoliath13

    Joined:
    Dec 3, 2017
    Posts:
    9
    I never would have figured this out. You are a hero!!! This fixed it for me!
     
  6. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    Still though, I hope Unity gets around to fixing this.

    @benoitd_unity @uDamian @uMathieu can you please confirm you've seen this issue? It's still occurring on Unity 2020.3.6f1.