Lately, I have been struggling building my project with Unity versions 2018 and 2017, all of them resulting in Building Failed with:
UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89
I am building for Windows (not Android as all solutions suggest for it) and I have no idea how to fix it.
I tried to look over the editor log but nothing suspicious pops up there.
If you have any suggestions please do tell them as I am approaching the last 10% of my project and I cannot afford to get back to my last backup 3 months ago.
Same problem and the solution by @unityChu does’nt work for me
I had the same problem, solved it by cleaning unity’s cache:
Edit->Preferences->GI cache-> clean cache
Please go download JDK 8.131 and Android SDK 25.2.5. It worked for me!!! Good luck!!!
Same here, this solution not working
Same, I Can’t Build An APK, But i can build an exe, here’s my error:
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:187
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94
i had that problem and i solved getting into player settings and check if you company name its the same in player settings >> other settings >> Package name after that try restarting unity and build your apk in another folder
I did all of mentioned above. When i changed bundle version code to +1 it suddenly worked. Something tells me that this didn’t fix it, but it triggered some kind of rewrite of the build settings which fixed it. Try mess a bit around with your build player settings and see if that helps.