- Home /
Cannot Build for Android
Hi,
I have been trying to build for Android for the past 7 hours and every suggested solution for similar errors I have tried doesn't work.
The errors I am getting are:
CommandInvokationFailure: Failed to build apk. C:/Program Files/Java/jdk-9\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:\Users\USERNAME\AppData\Local\Android\Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
and
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()
Given the " (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] " part of the second error, I have tried saving my apk to other directories, desktop, C:, Documents, nothing makes a difference.
Anyone know what is going on here?
My SDK and JDK are both up to date. Any help would be really appreciated.
Thanks.
There's nothing more to the error than that? I'm assu$$anonymous$$g you have unity configured normally for android and you've tried reinstalling Unity, the Android SD$$anonymous$$, and JD$$anonymous$$?
Thanks, this is actually my first attempt to build for Android, no there is nothing more to the two errors that that. I'm not sure exactly what you mean by configured normally for Android, I've installed the neccessary SD$$anonymous$$ though, and I even tried to build an empty scene with just a cube, but I get the same error.
I have tried reinstalling Android SD$$anonymous$$ and JD$$anonymous$$, I haven't tried reinstalling Unity, I guess I will have to give that a go.
Answer by TheMonkeysaur · Oct 03, 2017 at 08:16 PM
Is anyone able to let me know what these errors mean or how to fix them so I can build my game for Android?
Answer by $$anonymous$$ · Oct 06, 2017 at 05:24 AM
I guess the answer is to use JDK 8 as the newest version is incompatible.
Your answer
![](https://koobas.hobune.stream/wayback/20220612140138im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Should we download android modules again? 1 Answer
How to correct the errors with my android build 0 Answers
Bug border android build 0 Answers