Unity build errors

0

I am getting the following error when trying to build for PC/Windows:

UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player because scripts have compile errors in the editor at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96 UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

I have googled this issue, and the answers I found were:

  1. Re-import all assets
  2. Remove the .sln files (Visual Studio solution files) from your project
  3. Change the build folder to outside the project
  4. Remove the Plugins folder from the Assets folder

I did 1-3 and the problem remains. #4 doesn't make since, because I have plugins which are required in that folder. The project is compiling and running inside Unity, but it just won't build.

My Unity version is 2018.3.4f1, if that helps...

Can you please advice? This is extremely frustrating and I am fighting this over 2 days now

Yonatan Bashan

Posted 2019-04-17T17:36:33.163

Reputation: 1

Answers

-2

I have met the same problem. Finally I deleted some dll file of my project, like System.Windows.Forms.dll. Unity cannot compile them. You may go to find some alternative solutions without these dlls. I have found some steps to fix it. 1. delete System.Windows.Forms.dll. 2. change .NET Standard 2.0 to .NET 4.x in player settingsenter image description here 3.Add mcs.rsp in Asset and Write " -r:System.Windows.Forms.dll "in it. enter image description here 4. Restart Unity. I have fixed my problem following these steps.

Jay Saligia

Posted 2019-04-17T17:36:33.163

Reputation: 1