0

Unity is not building to android with this error:

CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. 
D:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Ben/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity5.5.1\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.BuildPlayerWindow:BuildPlayerAndRun()

I have my path variables set up correctly in the Unity editor, and I believe that I have my setup all correct in the actual SDK. Here is my SDK:

enter image description here

I'm on Unity 5.5.1f1, and Android Studio 2.3

BenjaFriend
  • 664
  • 3
  • 13
  • 29
  • Follow the direction from the duplicated question. Let me know if there is a problem. – Programmer Apr 05 '17 at 02:15
  • That didn't help, I am getting the same error. Here are my file paths: `C:/AndroidSDK/sdk` `C:/Java/jdk1.8.0_121` @Programmer – BenjaFriend Apr 05 '17 at 02:48
  • Please put a screen shot of what your paths looks like from Unity's setting. – Programmer Apr 05 '17 at 02:56
  • Work around [here](https://issuetracker.unity3d.com/issues/android-build-fails-when-the-latest-android-sdk-tools-25-dot-3-1-version-is-used) The tools folder was broken, it is a known issue. – BenjaFriend Apr 05 '17 at 02:58
  • This problem can be caused by many things. It can be cause by using \ instead of / or by providing the wrong path. I can also be cause by updating to a version SDK Tools. Unity has been fixing them but they keep coming back once in a while. Glad you fixed it! – Programmer Apr 05 '17 at 03:06
  • Thanks for the help! – BenjaFriend Apr 05 '17 at 03:10
  • Should this be marked as not duplicate because it was a different issue? – BenjaFriend Apr 05 '17 at 03:10
  • I will remove the duplicate if it is a different problem. Are you sure that downloading the SDK from the linked answer did not solve the issue? – Programmer Apr 05 '17 at 03:15
  • Yes I am sure. Trust me I tried several file paths to the SDK and JDK before I posted here as well. – BenjaFriend Apr 05 '17 at 15:30

0 Answers0