Strange Error Every Time I Newly Open My Project

This is not a typical NullReferenceException post, as that usually happens when you don’t setup a reference to an object before using it. This is an error that I get every time I open Unity. Well, actually 2 types of errors. It starts with:

RELEASEALLSCRIPTCACHES DID NOT RELEASE ALL SCRIPT CACHES

And then I get about 18-20 of the NullReferenceExceptions:

NullReferenceException: Object reference not set to an instance of an object UnityEditor.UIElements.UIElementsEditorUtility…cctor () (at /Users/bokken/buildslave/unity/build/Editor/Mono/UIElements/UIElementsEditorUtility.cs:60)

Thereafter, if I select any GameObjects in the hierarchy, the same NullReferenceException error appears in the console and the inspector window is completely blank.

I found a really silly hack to fix this. Unity needs to recompile the scripts, so I edit/save a script in VSCode and I come back to Unity and magically the errors go away and the inspector shows the components as expected.

I have submitted a bug report, but it seems bug reports often fall on deaf ears, so I’m testing the waters here to see if someone has some insight on how to sort out a real fix for this.

Cheers,

Happens to me as well…

Okay! Hey! I just upgraded to 2020.1.1.11f1 and this bug has gone away!

1 Like

@erikbethke Thanks for the update. Were you on 2020.1.9f1 while the bug occurred? That is when it occurred for me.

Cheers

We’re still seeing the same problem on 2020.1.13f1. Has anyone found a fix?

1 Like

I deleted the Library folder and Unity rebuilt it and everything was ok afterwards. I lost my layout of the editor, but everything else seemed normal

@highpockets Deleting Library only works once for us, on the next launch Unity crashes again.

1 Like

@oobartez have you tried re-importing your assets? → “Assets/Reimport All” It has been a while since I resolved this issue, but I do remember trying various things and reimporting all assets was one of them along with clearing cache. To be quite honest, I don’t know what the exact problem was and funny enough, Unity didn’t either. Hope you find the solution