Unity Build error

When I try to export my project, I get these error messages.

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors

at
UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <6ca5a1eeed924aafabbbb98281c05418>:0

at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <6ca5a1eeed924aafabbbb98281c05418>:0

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Build completed with a result of ‘Failed’ in 31 seconds (30603 ms)

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

UnityException: Build path contains project built with “Create Visual Studio Solution” option, which is incompatible with current build settings. Consider building your project into an empty directory.

UnityEditor.WindowsStandalone.WindowsDesktopStandalonePostProcessor.CheckSafeProjectOverwrite (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/WinPlayer/Extensions/Managed/WindowsDesktopStandalonePostProcessor.cs:69)

DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <6ca5a1eeed924aafabbbb98281c05418>:0)

Rethrow as BuildFailedException: Exception of type ‘UnityEditor.Build.BuildFailedException’ was thrown.

DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <6ca5a1eeed924aafabbbb98281c05418>:0)

UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <6ca5a1eeed924aafabbbb98281c05418>:0)

UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <6ca5a1eeed924aafabbbb98281c05418>:0)

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Can someone help me.

Hello,

Sometimes this happens to me and there seems to be nothing wrong. Turns out in many of my cases that there are c# Usings staetments no longer or not needed. Try to remove any usings that are not in use.

Good luck,
Chris

UnityException: Build path contains project built with “Create Visual Studio Solution” option, which is incompatible with current build settings. Consider building your project into an empty directory.

Change your build path, and build it into a new empty folder.

Some Steps To Try

  • Go to preferences → External Tools → and select regenerate project files.
  • Go to File → Build Settings - > Build and point to a new folder for your output.

Last Resorts

  • Restart Unity
  • Restart Your PC

Suggestion

I would strongly recommend rewriting your question in a way the demonstrates some level of professionalism.
Otherwise many developers who might otherwise help you and likely have a solution may pass you by.
Don’t be messy, it won’t help you on your developer journey.

I have the same issue on Unity 2022.1.23f1 too
I can’t build to android!