editor build related issue in 2018.1

Been spinning my wheels all day trying to fix this error in my 2018.1 project. I did extensive search and everything indicated it was related to having a rogue script not properly excluding the ‘using UnityEditor’ directive from the script. I went through every bloody script in the project, and added the “#if UNITY_EDITOR” exclusion and the same error keeps appearing. Help, I’ve run out of options!! :slight_smile:
The error message I’m seeing is this:

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Also, to clarify, I’m building into a directory completely separate from my Unity project assets, as I know others have had problems with that.

I recommend you look at the Editor.log file as Unity often outputs more detailed errors to the log that aren’t written to the Console window in the editor.

Here is what I would do…

  • Restart editor (to clear editor.log)

  • Create a build (which eventually fails)

  • Open Editor.log in text editor

  • Search for “UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors”

  • Scroll upwards in editor.log to see if any error was generated prior the BuildMethodException

Appreciate the response.
That file seems like it would be useful, although in this case, I’m not seeing anything jumping out.

Here is excerpt from that file (I selected ‘Full’ logging) showing immediately before/after the error:

0x0000000049148357 (Mono JIT Code) [GUIUtility.cs:184] UnityEngine.GUIUtility:ProcessEvent (int,intptr)
0x000000004914850E (Mono JIT Code) (wrapper runtime-invoke) :runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr)
0x00007FF933F3668F (mono) [mini.c:4937] mono_jit_runtime_invoke
0x00007FF933E88A95 (mono) [object.c:2623] mono_runtime_invoke
0x0000000140BDDC2A (Unity) scripting_method_invoke
0x0000000140BD67F0 (Unity) ScriptingInvocation::Invoke
0x0000000140BD20AA (Unity) ScriptingInvocation::Invoke
0x00000001403FB28E (Unity) IMGUIScriptingClasses::ProcessEvent
0x000000014132C804 (Unity) GUIView::ProcessRetainedMode
0x00000001415AAF92 (Unity) GUIView::OnInputEvent
0x000000014132C74C (Unity) GUIView::ProcessInputEvent
0x00000001415AC486 (Unity) GUIView::ProcessEventMessages
0x00000001415A5AC2 (Unity) GUIView::GUIViewWndProc
0x00007FF97767B85D (USER32) CallWindowProcW
0x00007FF97767B1EF (USER32) DispatchMessageW
0x00000001415C4261 (Unity) MainMessageLoop
0x00000001415C65DC (Unity) WinMain
0x000000014271FDA7 (Unity) __scrt_common_main_seh
0x00007FF977391FE4 (KERNEL32) BaseThreadInitThunk
0x00007FF977DEF061 (ntdll) RtlUserThreadStart
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89
0x00000001414F00A9 (Unity) StackWalker::GetCurrentCallstack
0x00000001414F66B6 (Unity) StackWalker::ShowCallstack
0x000000014138F54B (Unity) GetStacktrace
0x0000000140888ADC (Unity) DebugStringToFile
0x0000000141F886A8 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x00000000569D09BB (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
0x00000000569D08A4 (Mono JIT Code) [DebugLogHandler.cs:9] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[ ])
0x00000000569D019A (Mono JIT Code) [Logger.cs:47] UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000000569CFEA3 (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
0x000000005526B5DC (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:94] UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x0000000055267CE3 (Mono JIT Code) [BuildPlayerWindow.cs:885] UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform)
0x000000004C68EAD7 (Mono JIT Code) [BuildPlayerWindow.cs:810] UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
0x000000004C66F401 (Mono JIT Code) [BuildPlayerWindow.cs:415] UnityEditor.BuildPlayerWindow:OnGUI ()
0x0000000005327BF2 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)

Figured it out (finally). Found the error much further up in the log file. Had to do with a Windows Mixed Reality dll that couldn’t be located.

1 Like