As a newer Unity user, I've never had this problem before. I looked around on the internet and didn't find any help except to reimported all my assets which did not help.
I get these errors when building to any Platform:
Assets/Scripts/MainMenuManager.cs(41,21): error CS0234: The type or namespace name
EditorApplication' does not exist in the namespace
UnityEditor'. Are you missing an assembly reference?Error building Player because scripts had compiler errors
Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:187 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
NullReferenceException: Object reference not set to an instance of an object UnityEditorInternal.AnimationWindowControl.GetAnimationModeDriver () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:474) UnityEditorInternal.AnimationWindowControl.get_previewing () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:340) UnityEditorInternal.AnimationWindowControl.get_recording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:390) UnityEditorInternal.AnimationWindowControl.StopRecording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:421) UnityEditorInternal.AnimationWindowControl.StopPreview () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:361) UnityEditorInternal.AnimationWindowControl.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:105)
NullReferenceException: Object reference not set to an instance of an object UnityEditorInternal.AnimationWindowControl.GetAnimationModeDriver () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:474) UnityEditorInternal.AnimationWindowControl.get_previewing () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:340) UnityEditorInternal.AnimationWindowControl.get_recording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:390) UnityEditorInternal.AnimationWindowControl.StopRecording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:421) UnityEditorInternal.AnimationWindowControl.StopPreview () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:361) UnityEditorInternal.AnimationWindowControl.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:105) UnityEditorInternal.AnimationWindowState.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowState.cs:315)
NullReferenceException: Object reference not set to an instance of an object UnityEditorInternal.AnimationWindowControl.GetAnimationModeDriver () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:474) UnityEditorInternal.AnimationWindowControl.get_previewing () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:340) UnityEditorInternal.AnimationWindowControl.get_recording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:390) UnityEditorInternal.AnimationWindowControl.StopRecording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:421) UnityEditorInternal.AnimationWindowControl.StopPreview () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:361) UnityEditorInternal.AnimationWindowControl.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:105) UnityEditorInternal.AnimationWindowState.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowState.cs:315) UnityEditor.AnimEditor.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimEditor.cs:363) UnityEditor.AnimationWindow.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindow.cs:72)
NullReferenceException: Object reference not set to an instance of an object UnityEditorInternal.AnimationWindowControl.GetAnimationModeDriver () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:474) UnityEditorInternal.AnimationWindowControl.get_previewing () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:340) UnityEditorInternal.AnimationWindowControl.get_recording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:390) UnityEditorInternal.AnimationWindowControl.StopRecording () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:421) UnityEditorInternal.AnimationWindowControl.StopPreview () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:361) UnityEditorInternal.AnimationWindowControl.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs:105) UnityEditorInternal.AnimationWindowState.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowState.cs:315) UnityEditor.AnimEditor.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimEditor.cs:363)
I don't know what any of this means and I can't find any other information on it. I haven't upgraded Unity or anything like that.