Every other time my 2020 (HDRP) project loads I get a load of UIElements related errors
Quite a mess on a simple project - log below, but many more errors continue and you have to restart the editor
Symbol file LoadedFromMemory doesn't match image D:\work\project\Library\PackageCache\com.unity.ext.nunit@1.0.0\net35\unity-custom\nunit.framework.dll
ReleaseAllScriptCaches did not release all script caches!
(Filename: C:\buildslave\unity\build\Runtime/Mono/MonoManager.cpp Line: 1455)
Remaining caches:
UnityEngine.UIElementsModule:UnityEngine.UIElements:StyleSheet
Native extension for WindowsStandalone target not found
Native extension for WebGL target not found
Refreshing native plugins compatible for Editor in 69.53 ms, found 8 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
NullReferenceException: Object reference not set to an instance of an object
at UnityEditor.UIElements.UIElementsEditorUtility..cctor () [0x0003d] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
at UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () [0x00045] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
at UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) [0x00011] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
at UnityEditor.UIElements.DefaultEditorWindowBackend.OnRegisterWindow () [0x0000d] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
at UnityEditor.UIElements.DefaultEditorWindowBackend.OnCreate (UnityEditor.IWindowModel model) [0x000fe] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
at UnityEditor.GUIView.set_windowBackend (UnityEditor.IWindowBackend value) [0x0002e] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
at UnityEditor.GUIView.OnEnable () [0x00008] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
at UnityEditor.HostView.OnEnable () [0x0001a] in <6d0b5326886a4f0e8ed4ea356b37330b>:0
So this eased off, but in general UIElements seemed to be the root of (or maybe just surface of) a lot of errors in 2020, not a good sign. However I have not had consistency to make a bug report and run into other more pressing ones
Same here on a project that was updated directly from 2017 to 2020. UI errors on startup and sometimes when I try to open a window.
Error when I tried to open the Project Settings window:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <67055f1be3654e2a987254d5437ee5b8>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.EditorToolbar.CreateRoot () (at <67055f1be3654e2a987254d5437ee5b8>:0)
UnityEditor.EditorToolbar.get_rootVisualElement () (at <67055f1be3654e2a987254d5437ee5b8>:0)
UnityEditor.Toolbar.PositionChanged (UnityEditor.GUIView view) (at <67055f1be3654e2a987254d5437ee5b8>:0)
UnityEditor.GUIView.SetPosition (UnityEngine.Rect newPos) (at <67055f1be3654e2a987254d5437ee5b8>:0)
UnityEditor.View.set_position (UnityEngine.Rect value) (at <67055f1be3654e2a987254d5437ee5b8>:0)
UnityEditor.MainView.SetPosition (UnityEngine.Rect newPos) (at <67055f1be3654e2a987254d5437ee5b8>:0)
UnityEditor.View.set_position (UnityEngine.Rect value) (at <67055f1be3654e2a987254d5437ee5b8>:0)
UnityEditor.ContainerWindow.OnResize () (at <67055f1be3654e2a987254d5437ee5b8>:0)
I am also having this problem whenever I’m opening the project, sometimes I have to replace the default layout in the project library to even get to access the project (otherwise it forces me to quit). I am not using any custom windows or layouts.
If anyone finds a solution please post it here.
ReleaseAllScriptCaches did not release all script caches!
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnRegisterWindow () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnCreate (UnityEditor.IWindowModel model) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.set_windowBackend (UnityEditor.IWindowBackend value) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.HostView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnRegisterWindow () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnCreate (UnityEditor.IWindowModel model) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.set_windowBackend (UnityEditor.IWindowBackend value) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.HostView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.DockArea.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnRegisterWindow () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnCreate (UnityEditor.IWindowModel model) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.set_windowBackend (UnityEditor.IWindowBackend value) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.HostView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.DockArea.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnRegisterWindow () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnCreate (UnityEditor.IWindowModel model) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.set_windowBackend (UnityEditor.IWindowBackend value) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.HostView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.DockArea.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.EditorToolbar.CreateRoot () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.EditorToolbar.get_rootVisualElement () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.Toolbar.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnRegisterWindow () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.OnCreate (UnityEditor.IWindowModel model) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.set_windowBackend (UnityEditor.IWindowBackend value) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.GUIView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.HostView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.DockArea.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.EditorWindow.get_rootVisualElement () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.PropertyEditor.LoadVisualTreeFromUxml () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.InspectorWindow.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.SceneView.CreateCameraRectVisualElement () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditor.SceneView.OnEnable () (at <3b1af5075b0340cfb428dfcef292b2ea>:0)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
And when I get this I can’t choose any of the first two, it forces me to quit and I have to recopy the CurrentLayout-default dwlt in the project library folder to get it to work again.
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <9ddd600ae5964fe0b21a870e08c53748>:0)
Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
UnityEditor.UIElements.UIElementsEntryPoint.CreateRoot () (at <9ddd600ae5964fe0b21a870e08c53748>:0)
UnityEditor.UIElements.UIElementsEntryPoint.GetRootVisualElement (UnityEditor.EditorWindow window) (at <9ddd600ae5964fe0b21a870e08c53748>:0)
UnityEditor.EditorWindow.get_rootVisualElement () (at <9ddd600ae5964fe0b21a870e08c53748>:0)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at <9ddd600ae5964fe0b21a870e08c53748>:0)
UnityEditor.InspectorWindow.RedrawFromNative () (at <9ddd600ae5964fe0b21a870e08c53748>:0)
Hey all! I am late to the party but figured I would offer up what worked for me to see if it helps you. All I did was go into my game files "(Game Folder) → Library and delete the folder titled “UIElements.” By doing this, unity automatically remade the elements folder fresh, and my UI in-game was not harmed and worked perfectly. Let me know if this quick fix works for you as well as me. Have a great day!
I thought this worked at first, but then the error returned later. As previously reported, the errors appear every other time the project is loaded. So effectively, I need to load a project twice before I can work.
DC
Yep, I have to reload twice to get it to work, but it is honestly worth it. Would hate to restart a whole game for a dumb bug like this. Unity should look into fixing this, as it is very nerve-racking. The fix I gave you was just temporary. Make sure to check your files for the “UIElements” folder, as I have had it return multiple times, and had to delete it before build + running it. Have a great day!
…the issue seemed to be fixed after I reset the UI window layout to factory settings. I previously had a number of windows in tabs, such as project settings, profiler, shadergraph etc, so perhaps one or more of those window settings are incompatible with the 2020 version.
DC