Build failed with errors. at UnityEditor.BuildPlayer+Default buildMethods how to resolve it ? (191419)

I am following Building Unity game for an Android device for the testing tutorial I have followed all the instruction but I am getting this error in the end. from this link
https://unity3d.com/learn/tutorials/topics/mobile-touch/building-your-unity-game-android-device-testing

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
UnityEditor.HostView:OnGUI()

I also get this error with unity editor 2017.1.0f3

I had the same issue. I closed the complier (VS 2017) and then when I wanted to build the project, I changed the folder.

I have the same error, I installed Unity 2017.1 and configured Android. I have a simple project, but when I build for android I get this error: "UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors."

hi, well only got this error. how to fix, got the latest unity 2018.2.18 64 bit pro. driving me nuts, and don't know why this is doing it. did find the strange character and now, don't get this error. pasting below. able to help. please e-mail me via startrekcafe@gmail.com for help. how to fix. pasting below. driving me nuts and never seen this error before. that's prenpreventing me from building. help! Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Solve Immediately [Click Here][1] [1]: https://www.fiverr.com/share/wkKLdr

41 Answers

41

As you have noticed after you click build settings you are prompt to download it in the asset, which unity wouldn’t allow to build exe files inside asset. in that case, try building it in a different folder or in desktop. It works fine for me! :smiley:

Thank you, i change the folder and it work! best regards.

Worked for me, a huge thanks to you!

Hi, I haven't resolve the issue yet. Did you say to change the folder when you click on "build" button and choose the folder where you have to save the apk file? Because I've tried to do this and it doesn't work. Can you explain to me if i'm doing something wrong?

Didn't work for me.

It worked for me after building in different folder

Try using the build option ( not build & run )

  • ( it worked for me )

It worked for me!

This worked (clean build) as the issue happened after a unity project upgrade

when I had this error and “CommandInvokationFailure”, I went to the peferences and changed my jdk to 1.8 from 1.7, It worked.

thanks man it really worked for me.

This worked for me as well. [ Download link for the lazy.][1] [1]: http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html

How to change version?

Got same problem. This is how I solved it:
1.In “tools” directory of android SDK open a file named ‘android’ and in the list choose all 25-versions - install those packages (Note: this file didn’t want to open while my SDK was installed in C-System, so I was supposed to copy whole SDK in another one and it finaly launched );
2. Install JDK-8, not 9! Even if you have 9-version, download 8 and in Unity in Edit->Preferenses change jdk path to 8-version.
After this two steps I finaly resolved my problem. Good luck, hope it will help someone :slight_smile:

Thanks jdk 8 did it work. I had 10 and i had the same problem

Fixed it for me, thanks!

I have the same error, I installed Unity 2017.1 and configured Android. I have a simple project, but when I build for android I get this error: “UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.”

If you track the error that bring you to UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent deprecated method.

comment out it then try.
hope this will helpful.

Try to install the latest version of build tools, that fixed the problem for me.

This worked for me! Thanks. I was using MAC. I updated to the latest Android SDK using Android Studio. This problem happened after I upgraded Unity to version 2017.x

Hi
It helped me !!!
Build System change to Gradle

Worked for me!!! Thank you!!!

Close and Re-open Unity Editor

So this is a generic “something went wrong” message. There should be another message before it saying what caused the problem.
Hence the reason all the answers here being for different problems.

The trouble is that the actual error messages do not always show in the Editor.
Save/Re-Open etc… sometimes shows you the real error message. A Re-Import all often works if you have a couple hours to kill.
But, you can often find the actual error message in the
Editor LogFIle. It takes a lot of searching through, but it is normally in there somewhere.
Why they don’t make it through to the editor i’m not sure, but it is definitely worth a look.

Here’s something that worked for me…
Tested on Unity 2019.2.9f1
Notice that you should have the latest sdk + jdk8

1.Close Unity
2.Delete the “.gradle” folder in: "C > User > username > "
3.Connect to the internet with a stable connection
(because unity’s gonna download the required files itself during the build)
4.Now open up your project and just Build with the default build settings

Building the Gradle file will take some time for the first time and it may look freezed around 30Mins or more… but just let the unity do the job.
Download’s gonna be near 250MB

worked for me! Thanks!

restart unity that worked for me

Basically, your spawn points. If I’m assuming correctly, your spawn points are just empty gameobjects right? You could create a script that instantiniates a specific prefab each time at that spawn point. Though that would take away the randomness element, but if they’re all the same model it shouldn’t be too different.

I had selected “strip assemblies” in player settings and I was getting this error and APK was not building. But when I disabled stripping The APK is building but still getting this error message in console. anyone knows why?

EDIT: I was making for Android. After updating Android SDK I didn’t get any error. So if you are making for android make sure Android SDK and JDK are updated.

Got the same issue. I “Fixed it” by building in a pro version.

Please let me know if you solve this in personnal mode!

yaa I didn't know about this. Now it is working fine. Thanks!

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.

Had crash when building windows executable.

Fixed it by changing build architecture to x86_64 in build settings

I fixed my error by re-saving all scenes and the project before building, even though there was nothing new to save.

Well, most things related to the serialization system [is mentioned here][1]. Though this difference isn't explicitly mentioned here. There are some official blog posts like [this one][2] which might help a bit. [1]: https://docs.unity3d.com/Manual/script-Serialization.html [2]: https://blogs.unity3d.com/2012/10/25/unity-serialization/

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

Can you please tell me how to re import the project :heart:

Thanks, really appreciate it!

I see your error is saying (Boolean askForBuildLocation, BuildOptions defaultBuildOptions).

Try building the app on some other location on your drive. Worked for me.