Build failed with Errors Please Help!

Hello guys!

my game fails to build with the following errors:

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()

Can anyone help me please!
Thanks a lot !!

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

Delete folder .vs and all Microsoft Visual Project file in your “Main Game” Folder
Close Unity, restart and rebuild.

Ok finally got mine to work. yay.

The problem for me was the SDK file (I had the same .cs 162 & .cs 83 errors)

First: In Unity : Edit > Preferences > External Tools and click Download.
It should take you to:

Second: Download Android Studio NOT just the Sdk at the bottom

Third: After Download go back into unity and click File > Build Settings >
Player Settings > ‘Other Settings’ (in inspector) and set the ‘Minimal API level’
to the highest setting ‘Android 7.1’Nougat’ (API level 25)’ and click ‘Build & Run’ (Not just ‘Build’)

This build will fail, but the fail pop up box will inform you what your devices API level is.(Mine is 23)
Put ‘Minimal API level’ back to the original setting (Min api level) after you’ve learned your API level.

Fourth: Start ‘Android Studio’ and on the bottom right of the main screen click ‘Configure’ >
‘SDK Manager’ > ‘Appearance & Behavior’ tab > ‘System Settings’ tab click ‘Android SDK’

Fifth: Now just Check the box with the ‘API level’ your device is at and click apply to download. (Remember file path)

Sixth: Once the download is complete go back into Unity: Edit > Preferences > External Tools
Beside SDK click browse and link it to the SDK folder of your API level download.
(Example: C:\Users\Anthony\AppData\Local\Android\sdk)

Go here http://answers.unity3d.com/questions/1380921/build-failed-with-errors-at-unityeditorbuildplayer.html?childToView=1414536#answer-1414536

hope that helps.

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

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

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

Managed to solve my build problem by downgrading the SDK. This guy gives a good step by step with links:
https://answers.unity.com/answers/1326427/view.html

After that I also had to downgrade JDK from 9 to 8.
Hope it helps!

If you are using C#, make sure you do not have using UnityEditor.

@Brutalise1337

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 there then I realised that the jdk version is not correct too. so download jd1.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.

I used task manager and closed Unity and then redownloaded the same version of unity. During the redownload, the unity installer gets rid of your previous unity installation and downloads the new one. This worked for me to get rid of that error.

Could not resolve all files for configuration internal aapt2_binary’. See the Console for details.

If you have unity IAP Folder, Try deleting it and check if error exists.
I just re imported that stuff and now every thing is working.

Guys Help how do you solve this ?

I have tried all possible way i have seen on YouTube