Search Unity

Error loading window layout.

Discussion in 'Editor & General Support' started by LucaHofmann, Sep 12, 2016.

  1. LucaHofmann

    LucaHofmann

    Joined:
    Feb 24, 2015
    Posts:
    12
    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:
    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.
    http://answers.unity3d.com/questions/289549/error-while-reading-window-layout.html

    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:
     
    Last edited: Sep 12, 2016
    unity_ffAjoH6LMfHEwQ likes this.
  2. kimcgm

    kimcgm

    Joined:
    Jul 30, 2013
    Posts:
    11
    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.
     
  3. mspencer

    mspencer

    Joined:
    Dec 20, 2016
    Posts:
    1
    I had this problem when the name of the EditorWindow subclass did not match the editor script filename. There were no compile errors.
     
  4. lazer

    lazer

    Joined:
    Aug 15, 2012
    Posts:
    23
    Seems the classname must not only match but also the script must live in an Editor/ folder.
     
    elseforty likes this.
  5. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    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.
     
    thefireowl likes this.
  6. RagoVK

    RagoVK

    Joined:
    May 16, 2017
    Posts:
    2
    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.

    :)
     
    Last edited: Jun 6, 2017
  7. elektrofobi

    elektrofobi

    Joined:
    Jul 26, 2017
    Posts:
    1
    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.
     
    cftcimert and devillee like this.
  8. devillee

    devillee

    Joined:
    Oct 22, 2016
    Posts:
    1
    dediğin gibi yaptım bende de düzeldi :)
     
    berukulama likes this.
  9. Lypion

    Lypion

    Joined:
    Aug 15, 2018
    Posts:
    1
    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?
     
  10. JanTuts

    JanTuts

    Joined:
    Dec 19, 2012
    Posts:
    8
    Thanks, that seems to solve it for me too :)
     
  11. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    290
    anyone found a fix for this,
    my c# files names are the same as my class names but i still get this error,
     
    Chentianyi02 likes this.
  12. Alumi

    Alumi

    Joined:
    May 1, 2015
    Posts:
    1
    It helps me after I rename the my-created EditorWindow