How can i fix this error. UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors

UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00207] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:172
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Build completed with a result of ‘Failed’
UnityEngine.GUIUtility: processEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00207] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:172
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:83
UnityEngine.GUIUtility: processEvent(Int32, IntPtr)

I had the same problem when I tried to build an app. I was using unity 2017.2.1f1.
I solved the problem by changing the tools in the sdk folder with the tools_r25.2.5 -
Download this file online here - Android SDK Offline: Android SDK Tools/Manager

First just rename the tools folder already present in sdk root folder with toolsXXXX and then
Unzip tools_r25.2.5 and copy its tools into the sdk root folder.

Still, the error was present then I realized that the jdk version is not correct. So download jdk1.8 here - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Download java kit 8u161 and then in Edit->Preferences ->External Tools
Set these jdk1.8 path and sdk path.

It worked for me after that and I built my first app using Unity 3d
I hope it works for you too.

  1. If you are using Unity Ads, disable it and delete the Unity Ads Folder in the Assets folder of your project. Restart Unity and try to build it again. I suggest you use Google Mobile Ads instead of Unity Ads !!!

  2. If you are not using Unity Ads… Make sure your package name is set up correctly. e.g: If your Product Name contains spaces like: My Game. Then package name should be; com.companyname.My_Game.

2.b. If your package name is set up correctly and it still fails, make sure your package name is set up correctly again. Else you can do this: Search on how to export your unity project so that you can import and build and run it using Android Studio

(Make sure There is enough Memory on Your Computer as well ! )

For me I just changed the settings to Internal and now it works fine!

144512-33333333333333333332222.png

they have changed the build settings so its not there anymore