Search Unity

  1. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice

Component of type GUI Text is no longer available in Unity. References to it will be removed!

Discussion in '2020.1 Beta' started by creat327, Sep 27, 2019.

  1. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,282
    Hi

    I know that GUI Text has been removed a few versions ago. So here his the thing, a project that I have from 2019.1 I'm trying to test and build&run on android using 2020.1, but when i build and run i get this error:

    Warning (yellow)
    Component of type GUI Text is no longer available in Unity. References to it will be removed!
    Error (red)
    Component could not be loaded when loading game object. Cleaning up!
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    And it fails to compile and run.

    I've checked all my scenes and prefabs and I can't find GUI Text anywhere. But when I try to build it keeps giving me that error. Also, I tried to write a script to find "GUIText" on all my project and point me to where it is... but since GUIText is not any type in 2020, it can't search for it.

    Conclusion, how do we fix this? How do we find where it is located and remove it?
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,483
    Have you tried looking for the component in 2019.1?
     
  3. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,282
    Yes but I can't find it. In any case the upgrade to 2019.3 and 2020.1 should remove it for you right?
     
  4. ascentress

    ascentress

    Unity Technologies

    Joined:
    May 4, 2017
    Posts:
    7
    Hello, this is a known bug that should be fixed reasonably soon. Unfortunately, for now you will have to manually find these references and remove them. The easiest way is to run a text search through your scene files (if you're using text serialization; if not - that's going to be a bit more complicated). You should look for anything matching !u!92 (the ID for GUILayer), !u!131 (the ID for GUITexture) or !u!132 (the ID for GUIText) and remove the entire entry up to the next component (i.e. the first line beginning with --- !u!XX below it).

    The problem here is that you don't see these loose components on GameObjects in the Editor, but the actual scene file does not get reserialized until you modify and save it. Thus, if no changes are made to the scene, it triggers the missing component check upon being loaded until it finally gets re-saved.
     
  5. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,282
    Well, it happens on 2019.3 and 2020.1... pretty annoying because the error doesn’t even tell you in which file it found it
     
    rizwandeveloper likes this.
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,483
  7. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,282
    It’s not only a problem of “warning thrown”... it is in fact an error thrown, and as such, it won’t build your game on android or iOS, blocking a customer release. So it is not something to take lightly
     
  8. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    462
    To be fair, relying on an alpha or beta version for a client release sounds like a irresponsible thing to do
     
  9. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,282
    Im reporting it here so it doesn’t make it to the final version. Not saying you should make releases with a beta/alpha. The idea is that it gets fixed before this turn final otherwise people won’t be able to make releases.
     
    phobos2077 and JoNax97 like this.
  10. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    462
    Ok, I misunderstood your post then. My apologies
     
    creat327 likes this.
  11. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,282
    So to conclude: 1) it's an error that will stop a release (so it's critical). 2) if the upgrade doesn't automatically remove it, the compilation error should at least tell you which prefab or scene has it, so you can load it up and resave (that's all it needs to do).
     
  12. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,483
    The title and severity rating of this issue have been adapted. It is a high priority issue and @ascentress is working on a fix.
     
    Last edited: Oct 4, 2019
    phobos2077 and creat327 like this.
  13. MaxUnity111

    MaxUnity111

    Joined:
    Mar 25, 2019
    Posts:
    11
    Hi, updated to Unity 2019.3, got an error for every scene:
    Component GUI Layer in Main Camera for Scene Assets/Scenes/FirstMenu.unity is no longer available.
    It will be removed after you edit this GameObject and save the Scene.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    but I didn’t use it at all in this project
     

    Attached Files:

  14. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,391
    In older versions of Unity, the GUILayer component got added automatically to every camera, so if you've upgraded the project, that's the cause.

    If you're not using OnGUI() in any MonoBehaviours, you can safely ignore the message.
     
  15. MaxUnity111

    MaxUnity111

    Joined:
    Mar 25, 2019
    Posts:
    11
    The error is critical, the project does not start,
    decided simply: turned off on the camera Flare Layer
     
  16. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    98
    This is the answer !
    Remove FlareLayer Component
     
  17. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    154
    Still happens in 2019.3.7!?
     
  18. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,483
    The error handling has been improved for this. It should now point you to the affected GameObject.
     
    phobos2077 likes this.
  19. Stacklucker

    Stacklucker

    Joined:
    Jan 23, 2015
    Posts:
    42
    @MaxUnity111 @Jelmer123 @LeonhardP
    The "Component GUI Layer in [...] is no longer available" error is still persisting and removing the FlareLayer Component doesn't resolve the issue for me. The Outline is not at all working/visible. Any help?
     
  20. unity_RF59Nda8jkbKBw

    unity_RF59Nda8jkbKBw

    Joined:
    Jun 3, 2020
    Posts:
    1
    Remove the component "Flare Layer" (main camera)
     
  21. gms123

    gms123

    Joined:
    Apr 26, 2017
    Posts:
    1
    I was also facing the same issue to be asked for removing GUI layer component but could not find that on the gameObject. So I randomly removed Flayer Layer component and the issue is magically gone now...!
     
  22. shefyg

    shefyg

    Joined:
    Oct 29, 2014
    Posts:
    1
    In my case I needed to remove the Flare Layer component from my main camera
     
  23. DenizYurur

    DenizYurur

    Joined:
    Nov 19, 2017
    Posts:
    3
    Uncheck the Flare Layer component box from your main camera...

    resim_2020-12-01_115857.png
     
    kjkj5868, pinaeong and vpmanwani like this.
  24. kjkj5868

    kjkj5868

    Joined:
    Mar 10, 2021
    Posts:
    1
    it works! thank you
     
    DenizYurur likes this.
unityunity