- Home /
InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread
Have been getting this error for quite a while now, no idea what it is. it is not intervening in my progress either!
full Error Message:
InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread
UnityEngine.Object.EnsureRunningOnMainThread () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:153)
UnityEngine.Object.GetInstanceID () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:73)
UnityEngine.Object.IsNativeObjectAlive (UnityEngine.Object o) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:182)
UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:140)
UnityEngine.Object.op_Inequality (UnityEngine.Object x, UnityEngine.Object y) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:405)
UnityEditor.ProGrids.GridRenderer.Destroy () (at Library/PackageCache/com.unity.progrids@3.0.3-preview.0/Editor/GridRenderer.cs:85)
UnityEditor.ProGrids.ProGridsEditor.Destroy () (at Library/PackageCache/com.unity.progrids@3.0.3-preview.0/Editor/ProGridsEditor.cs:409)
UnityEditor.ProGrids.ProGridsEditor.Finalize () (at Library/PackageCache/com.unity.progrids@3.0.3-preview.0/Editor/ProGridsEditor.cs:370)
UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)
Same here, not happening on my colleges machines on the same project though!
Answer by Salim · May 17, 2019 at 11:39 PM
Hey! I had the same problem, updating all my packages with the package manager fixed it for me.
Answer by codemaker2015 · Apr 29 at 02:38 PM
This might be an issue with the installed packages.
Try to update all packages with the package manager to solve this issue. If you are having any old package folder in the Assets folder you can delete it and try to add it again from the package manager or from a unity package.
Also, ensure that your target platform libraries are not colliding which means there might be the same library files in a different folder. In that case, delete one of them and try to build it again.
Your answer
Follow this Question
Related Questions
I have an error "MissingReferenceException" and i dont know why 1 Answer
Unity keeps saying that the "Sequence contains no elements" 2 Answers
Monodevelop Fatal Error 0 Answers
Errors i can't understand. SetSystemInterested 1 Answer
Every time I create a new project this error appears in the console 1 Answer