Search Issue Tracker

Fixed in 2018.3

Votes

3

Found in

2017.3.0b6

Issue ID

961766

Regression

No

CommandInvokationFailure: Unable to list target platforms when using Android SDK > 25.2.5

--

-

CommandInvokationFailure: Unable to list target platforms when using Android SDK > 25.2.5

This happens for both Windows and OSX, if the JAVA_HOME environment variable is not set.

Repro steps:

Install an Unity version with the Dowload asistant. Pick Editor and Android Tools
Ensure you have JDK 1.8. There is an issue with building with JDK 1.9 anyway
Navigate to Preferences->External Tools-> Android->download
this will thake you to ASndroid Studio. Download Android Studio
Chose to install the latest SDK, (26) or 25..
After instalation, go to Preferences->External Tools-> Android and chose the location where Android Studio installs the SDK.
The default is: C:\Users\[yourusername]\AppData\Local\Android\sdk

Try to build
The error you get:

-----------No.1----------------
Error:Invalid command android
UnityEditor.HostView:OnGUI()
-----------No.2------------------------
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/JG/AppData/Local/Android/Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error:Invalid command android
]
stdout[

]
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()
-------------No.3-------------------------------
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/JG/AppData/Local/Android/Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error:Invalid command android
]
stdout[

]
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()
--------------No.4---------------------------------
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/JG/AppData/Local/Android/Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error:Invalid command android
]
stdout[

]

Reproduced with:
2017.2f3, 2017.3b5 and b6, 2018.1a1
But users have had this issues with 5.4 and 5.6 too...
http://answers.unity3d.com/questions/1323731/unable-to-list-target-platforms-please-make-sure-t.html

License type: Pro

Comments (5)

  1. B20103b424b86bbf5720b777431c249b?d=mm

    IanZehner

    Jun 11, 2020 06:04

    This is someting unique and outstanding to read and get knowledge about the main issue , The Content selection regarding the topic is up to the mark.
    https://www.newamericanstore.com/

  2. 2adfaf9fa6f954b1cdb5b80458ac97f2?d=mm

    kevinbear741

    Jun 03, 2020 09:58

    Thanks for sharing this best stuff with us! Continue sharing! I am new in the blog writing. All types of online journals and posts are not useful for readers. Here the writer is giving acceptable contemplations and proposals to every single peruse through this article click here https://www.black-leatherjacket.com/Kingdom-Hearts-Organization-13-Coat..

  3. 2e2804ae7eb110a35e376fdf886930b7?d=mm

    kickstep

    Apr 09, 2019 04:22

    Does this only set JAVA_HOME when it is NULL / not defined?

    It seems to set JAVA_HOME to embedded OpenJDK even when it has already been set for JDK 8 (external).

    Cannot seem to configure this for headless builds (e.g. Jenkins) now.

  4. 189f1c5c2bba307099a9ae4158805db4?d=mm

    D3m0n

    Feb 20, 2018 02:34

    Same problem. Unity 2017.3.1p1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.