Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Scope was not disposed! You should use the 'using' keyword or manually call Dispose. UnityEngine.Sco

Discussion in 'Editor & General Support' started by GuyGershon, Jun 13, 2019.

  1. GuyGershon

    GuyGershon

    Joined:
    Jan 7, 2019
    Posts:
    1
    I can't access the player settings for some reason, when I try to access it, the following error is spamming the console -

    Code (CSharp):
    1. Scope was not disposed! You should use the 'using' keyword or manually call Dispose.
    2. UnityEngine.Scope:Finalize()
    I did try to search a solution online but I got nothing, any help would be appreciated.
     
    Last edited: Jun 13, 2019
    Tymianek likes this.
  2. Wezai

    Wezai

    Joined:
    Dec 30, 2016
    Posts:
    66
    I'm having the same issue on Android's Player Settings. The two Unity versions causing this is 2019.2.0b5 (beta) and 2019.3.0a5 (alpha).

    The stable release 2019.1.5f1 is working fine on that aspect so I recommended you use that one in case your version is one of the mentioned above.
     
  3. torboot11

    torboot11

    Joined:
    Jul 31, 2013
    Posts:
    4
    Having this too with 2019.3.0a7
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,908
    Has anyone filled a bug report? The callstack that was included with the error message would be useful.
     
  5. karabinenko88

    karabinenko88

    Joined:
    Jun 18, 2019
    Posts:
    1
    Same problem in version 2019.2.0f1.
    I just wanted to expand the Icon tab, after that a lot of errors appeared in the console and the Player became unavailable. And the errors appear exactly when the Player tab is pressed.
    I regret having updated to this version.
     
  6. tohaman77

    tohaman77

    Joined:
    Jul 31, 2019
    Posts:
    1
    Same problem in version 2019.2.0f1. Player unavailable.

    P.S. After "build and run" on my telephone, problem has gone.
     
    Last edited: Aug 6, 2019
  7. june9473

    june9473

    Joined:
    Apr 11, 2019
    Posts:
    1
    Thank you It works!!
     
  8. ArcIo

    ArcIo

    Joined:
    Apr 17, 2012
    Posts:
    19
    I can't build to the phone as I have to provide passwords for signing. Any other ideas?
     
    Vasilisk_ likes this.
  9. Vasilisk_

    Vasilisk_

    Joined:
    Oct 17, 2017
    Posts:
    1
    same problem
     
  10. TrollingDerper

    TrollingDerper

    Joined:
    Aug 20, 2019
    Posts:
    1
    I'm having the same problems as everyone here, I've just filed a bug report, so I guess all we can do it wait. I've tried all the different fixes people have suggested, but nothing is working for me.
     
  11. Domas_L

    Domas_L

    Unity Technologies

    Joined:
    Nov 27, 2018
    Posts:
    109
  12. Wezai

    Wezai

    Joined:
    Dec 30, 2016
    Posts:
    66
    It seems that to fix this bug you have to uninstall all the latest versions of Java (9 and above). If it's not Java 8 you will get issues. Try that and post back your results.
     
  13. Talscar

    Talscar

    Joined:
    Jul 20, 2016
    Posts:
    6
    I've resolved the problem tonight. To get the Project Setting/Player to open again, you need to uninstall the Android Developer tools. Since I deleted them forcefully with no official way to re-import or uninstall, my projects a bit broken and I am uncertain as to which SDK I should use.

    I filed a bug report as well and backtracked from what I mentioned in the report.

    Using Unity 2019.2.2f1
     
  14. Vortex1711

    Vortex1711

    Joined:
    Jun 9, 2018
    Posts:
    1
    A bit of a workaround. If you start exploring the Player options on other platforms (so IOS, PC) in the inspector and actually click on the tabs, then click on the Android icon in the inspector, the Android Player settings will work again. It will however break again once you click the Icon tab.
     
    b3x2088 likes this.
  15. unity_Lwp1iLehs6575A

    unity_Lwp1iLehs6575A

    Joined:
    Sep 6, 2018
    Posts:
    2
    This worked for me
     
  16. Kayson91

    Kayson91

    Joined:
    Jul 24, 2019
    Posts:
    2
    to fix this easily, just switch platform to pc and build. after that you can access into a player settings. you can too switch again to mobile platform
     
    DhiaSendi likes this.
  17. snw

    snw

    Joined:
    Mar 13, 2014
    Posts:
    41
    Just had the same issue while trying to compile for iOS on Mac (Unity 2019.2.10f1)

    From the console:
    "Scope was not disposed! You should use the 'using' keyword or manually call Dispose.
    UnityEngine.Scope:Finalize() (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUI.cs:1704)"


    Bug and workaround:
    It turned out that this was caused by having the "Project Settings" window open and undocked. As soon as I closed the window, compilation worked again without errors .
     
    Tamplier likes this.
  18. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,908
    Do you have the full callstack for this error?
     
  19. paragkikani

    paragkikani

    Joined:
    Apr 24, 2019
    Posts:
    3
    check android plugin if missing then install it other wise override on it. hope it's help full.
     
  20. DhiaSendi

    DhiaSendi

    Joined:
    May 16, 2018
    Posts:
    4
    Thanks !
     
  21. Tymianek

    Tymianek

    Joined:
    May 16, 2015
    Posts:
    27
  22. unity_9otyjMsgvgBCew

    unity_9otyjMsgvgBCew

    Joined:
    Apr 8, 2020
    Posts:
    1
    did you find its solution ?
     
  23. Develax

    Develax

    Joined:
    Nov 14, 2017
    Posts:
    27
    @karl_jones
    This happens when Projest Settings -> Script Execution Order window is open and I open another scene. First I see this errors:
    upload_2020-5-5_21-24-17.png
    Code (Boo):
    1. MissingReferenceException: The object of type 'MonoScript' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3. UnityEngine.Object.get_name () (at <05f2ac9c8847426992765a22ef6d94ca>:0)
    4. UnityEditor.ScriptExecutionOrderInspector+DragReorderGUI.IsDefaultTimeElement (UnityEditor.MonoScript element) (at <17b72532ee2c4da1b6f632d3f1705fe0>:0)
    5. UnityEditor.ScriptExecutionOrderInspector+DragReorderGUI.DragReorder (UnityEngine.Rect position, System.Int32 elementHeight, System.Collections.Generic.List`1[T] elements, UnityEditor.ScriptExecutionOrderInspector+DragReorderGUI+DrawElementDelegate drawElementDelegate) (at <17b72532ee2c4da1b6f632d3f1705fe0>:0)
    6. UnityEditor.ScriptExecutionOrderInspector.OnInspectorGUI () (at <17b72532ee2c4da1b6f632d3f1705fe0>:0)
    7. UnityEditor.AssetSettingsProvider.OnGUI (System.String searchContext) (at <17b72532ee2c4da1b6f632d3f1705fe0>:0)
    8. UnityEditor.SettingsWindow.DrawControls () (at <17b72532ee2c4da1b6f632d3f1705fe0>:0)
    9. UnityEditor.SettingsWindow.DrawSettingsPanel () (at <17b72532ee2c4da1b6f632d3f1705fe0>:0)
    10. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7be1a95b44f5474c9c1a5c5fd9c86b28>:0)
    11. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Then when I open another scene again I see these:
    upload_2020-5-5_21-27-0.png
     
    oriolmanya and dfeddon like this.
  24. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,908
    Could you please file a bug report?
     
  25. Develax

    Develax

    Joined:
    Nov 14, 2017
    Posts:
    27
    Where can I do it?
     
  26. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,908
  27. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,166
    please post the bug number when you have it so we can track it faster
     
    dfeddon likes this.
  28. oriolmanya

    oriolmanya

    Joined:
    Jul 4, 2012
    Posts:
    46
    It happened the same to me with 2019.3.13. Following the lead of somebody here I closed the Projects Settings (The window that Opens from Edit > Project Settings), and I was able to compile my Android game again.
     
unityunity