Search Unity

Strange Error Every Time I Newly Open My Project

Discussion in 'Editor & General Support' started by highpockets, Oct 26, 2020.

  1. highpockets

    highpockets

    Joined:
    Jan 17, 2013
    Posts:
    71
    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,
     
  2. erikbethke

    erikbethke

    Joined:
    Aug 11, 2018
    Posts:
    4
    Happens to me as well...
     
  3. erikbethke

    erikbethke

    Joined:
    Aug 11, 2018
    Posts:
    4
    Okay! Hey! I just upgraded to 2020.1.1.11f1 and this bug has gone away!
     
    highpockets likes this.
  4. highpockets

    highpockets

    Joined:
    Jan 17, 2013
    Posts:
    71
    @erikbethke Thanks for the update. Were you on 2020.1.9f1 while the bug occurred? That is when it occurred for me.

    Cheers
     
  5. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    We're still seeing the same problem on 2020.1.13f1. Has anyone found a fix?
     
    Ednale likes this.
  6. highpockets

    highpockets

    Joined:
    Jan 17, 2013
    Posts:
    71
    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
     
  7. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    @highpockets Deleting Library only works once for us, on the next launch Unity crashes again.
     
    goldcloud144 likes this.
  8. highpockets

    highpockets

    Joined:
    Jan 17, 2013
    Posts:
    71
    @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