Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Scope.Finalize() Errors

Discussion in 'Editor & General Support' started by Gizmoi, Feb 26, 2018.

  1. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    I'm getting lots of errors around using Unity (semi-) new Scopes.
    I'm primarily using EditorGUILayout.HorizontalScope and EditorGUILayout.VerticalScope, but I'm also using ScrollViewScope and some of my own custom scopes.

    I'm getting this error a lot:
    Code (csharp):
    1. Scope was not disposed! You should use the 'using' keyword or manually call Dispose.
    2. UnityEngine.Scope:Finalize()
     
    Khounine likes this.
  2. vzheng

    vzheng

    Joined:
    Dec 4, 2012
    Posts:
    44
    SAME ERROR WHEN BUILD PROJECT;
     
  3. zheyuanzhou

    zheyuanzhou

    Joined:
    Oct 29, 2017
    Posts:
    22
    I Even did not using EditorGUILayout.HorizontalScope and EditorGUILayout.VerticalScope. I dont know why
     
  4. ziemlich3D

    ziemlich3D

    Joined:
    Aug 21, 2017
    Posts:
    24
    I'm also not using anything of this but getting a tons of errors now...
     
  5. cadogames

    cadogames

    Joined:
    Jun 14, 2019
    Posts:
    1
    same problem
     
  6. Wezai

    Wezai

    Joined:
    Dec 30, 2016
    Posts:
    74
    The stable release is working fine for me, but the versions 2019.2.0b5 (beta) and 2019.3.0a5 (alpha) give me this "Scope.Finalize()" Errors. I noticed that in my case only the Player Settings of the Android module has this issue, if I change my project settings to a different platform it will work as normal. To be more precise, the "Icon Settings" is the culprit.
     
    xNex, mezio19 and Adefuye like this.
  7. magician_creator

    magician_creator

    Joined:
    Jun 25, 2019
    Posts:
    14
    exactly the same problem when pressing the icon settings. any ideas?
     
  8. jqubi

    jqubi

    Joined:
    Feb 7, 2019
    Posts:
    3
    Any solution to this? It happened out of nowhere on a project that was building fine just before. I reverted all my changes and deleted Library folder, but still can't build... (Unity 2018.3.14f1)
     
  9. jqubi

    jqubi

    Joined:
    Feb 7, 2019
    Posts:
    3
    OK, it seemed to be related to having tried to build with the Script Execution Order window opened. I moved to the player settings window and it went back to normal.
     
  10. Adefuye

    Adefuye

    Joined:
    Jun 3, 2019
    Posts:
    10
    I'm on 2019.3.0a7 and still gaming the same problem. when I click on player settings, 'Player' is completely blank and the findings spits out 20 errors, anyone find a solution?
     
  11. Wezai

    Wezai

    Joined:
    Dec 30, 2016
    Posts:
    74
    Have you tried using the stable version? Stable right now is 2019.1.5f1 I think, on that one it doesn't show any errors.

    If it works on that version then I think someone needs to formally report it as a bug happening on both beta and alphas if no one did it yet.
     
    Joe-Censored likes this.
  12. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  13. The-Gabo

    The-Gabo

    Joined:
    Feb 25, 2013
    Posts:
    10
    Hey, I deleted TextMeshPro package and the build worked.

    The bug indeed appeared when I moved some scripts around on the script execution order.

    Some package automaticly change the script execution order in code, so check out if no package changes the exe order, maybe i'll work for you.
     
    azadtouraj likes this.
  14. quzziy

    quzziy

    Joined:
    Jun 15, 2019
    Posts:
    4
    same here.... how to fix that??
     
  15. jleven22

    jleven22

    Joined:
    Mar 26, 2019
    Posts:
    396
    This was the issue for me. Have no idea why this bug exists!
     
    JanetRGilbert likes this.
  16. jeffsim

    jeffsim

    Joined:
    Feb 3, 2016
    Posts:
    8
    [TL;DR: the error for me was somehow related to script execution order, but fixing it required the additional step of restarting unity]

    I suddenly started getting this as well; in case it helps anyone else, here's what I did:

    Before the error:
    * I had various classes in the "before default" part of script execution order (SEO) and everything was working

    What caused the error:
    * Not 100% sure as I did a bunch of stuff, but among other things: I added two classes to the "after default" part of SEO. At that point it was happening consistently across reboots etc.

    What made the error go away:
    * I tried various combinations of removing the classes from SEO / moving them to the "before default" - none of that made a difference.
    * I restarted Unity w/o the classes in SEO and surprisingly it no longer popped the error.
    * I added the classes back to SEO, and error was still gone.

    So: as other folks mentioned, changes to SEO appear to have caused the issue for me at least; or at least be related.

    BTW, all this was in the testrunner for me.