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
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()
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!
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
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.”
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
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.
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.