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:
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:
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.
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.
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.
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?