I can run my application in the editor with no problem but when I try to build to Android, I get the following error between 3-9 times.
Destroy may not be called from edit mode! Use DestroyImmediate instead.
Destroying an object in edit mode destroys it permanently.
When I click it the only additional information I get is the following
Destroy may not be called from edit mode! Use DestroyImmediate instead.
Destroying an object in edit mode destroys it permanently.
UnityEngine.UI.Image:OnDisable ()
The other output is as follows:
Build completed with a result of ‘Failed’ in 14 seconds (14445 ms)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
&&
UnityEditor.BuildPlayerWindow+BuildMethodException: 6 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <7ac35247888b44f4a7e290f1f6bb33f3>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <7ac35247888b44f4a7e290f1f6bb33f3>:0
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
I am not calling destroy in any of my functions for editor and I have the editor calls wrapped in
#if USING_EDITOR
I’m really lost on this and can’t seem to get past a simple build. This issue occurred suddenly with no change to any code or scene. I pulled a new branch from version control where I know the application was running.
Any clues would be awesome.
INB4: Restart Unity, Try a new version, reinstall Unity, check build settings.