I cannot build to android Unity 2017.1.1f1 (Unable to List Target Platforms)
I have tried using Unity 5.6, Unity 2017 1.1f1, and the Unity Beta 2017.2.0f2 and I get the same error each time. I have the latest Android Studio, SDK, Java JDK, and Win 10. I have the correct paths in Unity that lead to the SDK and JDK. Everything in the program works perfectly, testing is done, I'm ready to market, and, yes, I've even done this before. But I cannot build my apk due to this system error.
Traditionally, this error is caused by a clash between Android Studio Tools and Unity. I have tried all the known workarounds that I can find (installing older versions of SDK Tools, older versions of Unity, beta versions of Unity, etc). I've been reading the manual, the forums, and the many workaround solutions. I've been swapping files and reinstalling everything for the last couple days and I just cannot get beyond this. The old workarounds are not working for me.
Does anyone know a way around this? Nothing theoretical, I want the Unity and Android Studio version pair that are actually allowing you to build right now. If you have a working Unity-AndroidStudio pair, I can, at least, figure out if it is just me or not.
Thanks!
Error follows: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. D:/Java/jdk-9\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Error:Invalid command android ] stdout[
] exit code: 64 UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.HostView:OnGUI()
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. D:/Java/jdk-9\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Error:Invalid command android ] stdout[
] exit code: 64
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()
I've been having the same problem all day, and trying different answers didn't work. I decided to nuke everything and start from scratch with a fresh install of 2017.1.1f1, Android SD$$anonymous$$, and JD$$anonymous$$, and then I followed this guide to manually install the specific JD$$anonymous$$ and Android SD$$anonymous$$ versions that work with Unity: http://devlog.markhlavac.com/2017/06/30/installing-android-sdk-for-unity3d-using-sdk-tools-and-cli/
(the only 2 things I had to do different was that (1) the Android SD$$anonymous$$ path needed to end in SD$$anonymous$$25/
and not SD$$anonymous$$25/tools/
and (2) I had to change the PATH environment variable entry for Java to point towards my JD$$anonymous$$8 installation) (not sure if you'd encounter the same issues though)
Answer by bgmulti15a · Oct 06, 2017 at 10:24 AM
First thing download and install JDK version 8 if you don't have it and set it as your jdk on unity (jdk path after installation is usually C:/Program Files/Java/jdk):
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Then download and extract this file:
https://dl.google.com/android/repository/tools_r25.2.3-windows.zip?hl=id
Inside you will find a folder called "tools", cut it.
Now go to the location where your sdk is located, usually the path is C:\Users\"username"\AppData\Local\Android\sdk (AppData is a hidden folder, make sure your system settings allow you to see hidden folders).
Now that you are inside the sdk folder, you will see a folder named "tools". Rename it as "tools_OLD".
Last but not least, paste here the "tools" folder that you have cut earlier.
This should work.
The main thing that helped me was this --> "Now that you are inside the sdk folder, you will see a folder named "tools". Rename it as "tools_OLD".Last but not least, paste here the "tools" folder that you have cut earlier."
Answer by nipundavid · Oct 19, 2017 at 04:45 PM
I tried the above solution , but it didn't worked in my case
Answer by bigremo · Oct 19, 2017 at 04:56 PM
In the end, i used Unity 2017.1.1f1 and the latest Android SDK, but had to use an older Java JDK (#8, not #9) to make it work. I did not need to change the tools files or anything like that, I used the latest as-downloaded, off-the-shelf versions of both Unity and Android SDK with the old Java JDK 8.
Answer by mcculloughj7 · Mar 03, 2018 at 11:17 PM
Having similar issues. jdf version 8 . did the "tools" swap. works now. so frustrating!
Your answer
Follow this Question
Related Questions
Error Building APK 1 Answer
Error while trying to build XCode project 0 Answers
Build completed with a result of 'Failed'. 0 Answers
Android SDK error build 7 Answers
Error building player because scripts have compile errors in the editor 1 Answer