Failling to build

UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83

I had the same error and I avoided it generating all lightmaps again (of each scene). I don’t know if this is the certain solution, but you can try it and see.


i had the same problem. In fact I had two problems I finlally could solve very easilly.

The first one I had, I think you haven’t is related to something very very silly… Saving the built to assets folder… That’s very bad for scripts (Have you…?)

The second one, which is what I think is happening to you is related to JDK version…
Take a look at Main Menu → Edit → Preferences. Now go to External Tools…

What JDK version do you have??? Maybe 1.7… Try updating to 1.8… That worked for me.

Good luck!

I am having this issue as well with no fix in sight… Can you expound on this lighmaps fix? @Camilohoyos16

Hey, I actually found a solution that worked for me… I had imported demos from some of the unity assets in my project, and those scripts were interfering with the build!

I just clicked on “Reimport all assets”. Then everything was fine.

try this.

hope this helps.

Just change the location of build(.apk) by default it’s set Assets folder.

You have to change it either at other folder of make new folder at Assets->Apks.

It’s works fine for me. It’s strange but works.

At first, I used JDK 9.0.4 (even latest JDK 10), and got these problem. Then I downgrade to JDK 8 and problem solved. So try JDK 8, not the latest one.