Error loading window layout.

Hello,

I am writing a custom EditorWindow. If I leave this window open while closing Unity I get some errors on the next startup of Unity. This window pops up:
2785284--201719--fail.png
Errors:

I commented out the whole initialization logic of my window. I imported my code to a new unity project and I finally installed Unity again. But the error still occurs. Any ideas?

I found this thread that seems to be the same issue.

According to the decompiled WindowLayout the first error ‘Failed to destroy views’ gets thrown if Resources.FindObjectsOfTypeAll(typeof(View)); returns an array with a length higher than 0.

If tried to save the current window layout using Window->Layouts->Save Layout and restart Unity. The result is, that the whole docking area where my window was docket is broken.
Errors:

1 Like

Had this problem happened to me after upgrading to Unity 5.5 (from Unit 5.3).

“Error while reading window layout: window #1 is null”
I didn’t know which window was causing the issue. I started closing all my custom EditorWindow (including external plugin from Asset Store), re-installing all plugins but still getting the error after many Unity restart.

Eventually narrow down to “Game” and “Scene” window.
I just closed Game and Scene windows (right-click on the tap and chose “Close Tab”), then re-attached them back to my layout (Ctrl+1/Cmd+1, Ctrl+2/Cmd2).
The error seems to have disappear for now.

5 Likes

I had this problem when the name of the EditorWindow subclass did not match the editor script filename. There were no compile errors.

4 Likes

Seems the classname must not only match but also the script must live in an Editor/ folder.

1 Like

Having the same issue in 5.4. Didn’t solve it yet but in my case this error is caused by loading objects with missing script reference. As far as I understand the missing scripts replaced with that FallbackEditorWindow internal class for showing us that the script being deleted instead of just showing null reference.

So if you having this issue I could recommend to check your project for missing scripts.

1 Like

I’ve got the same Problem: Editor-Script with own Window working fine until I close the Project and open it again. Then my own Editor-Window has disappeared and an Error-Message “Removed unparented EditorWindow while reading window layout” was in the Console.
mspencer’s Hint at #3 was the Trick: After I renamed my File.cs the same as my Class inside it, everything worked as it should ! My own Editor-Window can be alone or it can be docked to the Unity-Editor. When I close the Project and open it again, it’s at the same Place as before and no Error-Message any more.
My Script resides in /Assets/Editor/File.cs.

:slight_smile:

ben 5.4.4 versiyonunda bu sorunla karşılaştım. run an administrator modunda açınca olay düzeldi. Türkçe öğrenin amk.

2 Likes

dediğin gibi yaptım bende de düzeldi :slight_smile:

1 Like

hello, I have the same problem. The console window said Removed unparent EditorWindow while reading window layout when I restart my unity. Have you solved this problem?

Thanks, that seems to solve it for me too :slight_smile:

anyone found a fix for this,
my c# files names are the same as my class names but i still get this error,

1 Like

It helps me after I rename the my-created EditorWindow