Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details

  • Windows 10
  • Unity 5.4.2f2
  • JDK (I configed it.javac is worked in cmd) C:\Program Files\Java\jdk1.8.0_121
    androidSDK :C:\Users\JG\AppData\Local\Android\Sdk

the path in unity - edit-preferences is right.
and i really checked it for many times.

I tried use other SDK Platforms (API LEVEL 10,19,23),and sdk tools (23.03,24.03,25.02).
it is also the same error.

I dont konw how to do.
This Problem spent me two days.

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	ools" -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()

Same Problem here!

I had this exact same issue. The resolution below fixed it!

Will give it a go, but I'm fairly sure I've tried that already. Still, worth a shot. I'll let you know what happens.

Nope. Camera is still not sticking to the ship. It's secure on a position standpoint, the camera always moves with the ship the way it should, it just doesn't rotate at all except from the left stick input.

15 Answers

15

@DjangoJG

Hi,
finally I found a solution:

First I tried installing Android SDK and an older Version of JDK into folders with only three letters in the folder name directly on the desktop. But this was not the solution.

Then I fixed it by downgrading the android sdk tool version. Obviously the most current version (SDK Tools, Revision 25.3.0 (March 2017)) causes the trouble.

This is how you do it:

  1. Go to your Android SDK Folder.
    (If you did not change the path during Android Studio installation you will find the SDK folder here: C:\Users\YourUsername\AppData\Local\Android\sdk )

  2. Rename the old Android sdk “Tool” folder : [Your Android SDK root]/tools → toolsXXXX

  3. Download Android SDK Tools, Revision 25.2.5 (January 2017):
    http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip

  4. Extract that to Android SDK root folder.

  5. In Unity go to Edit>Preferences>External Tools and check again, that the path for Android SDK points to the correct folder. (The correct path is the SDK root folder, not the tools folder which is inside the root folder!)

  6. Build your project.

Worked fine for me!

Here some other guys who found the solution too:

This stupid version compartibility issue took one day to solve… :frowning:

Have fun developing!
Matt

Thanks for helping me out, this worked a treat.

oh~ thx a lot~

Worked like a charm ;) thank you!

Work great on me.. thanks man

Thanks so much for this answer. This has caused me a headache for some hours. Thanks man

It’s 5/21/2017 and this still issue still exists and this still fixes the issue.
Thanks!

THANK YOU! It’s almost September and this still is an issue!

@DjangoJG Exact same problem here, there is an issue with the latest version of the Android build tools.
I solved it using this post :

Thanks! @makemepulse

Thanks! @makemepulse

I met the same “Error Message” Thanks to @DjangoJG I know it is the stupid “tools” fail

so i try the following command and see Exception, The problem depends on your detail exception. For me it happens when I have java7 install while android classes are java 8 later. so upgrade to Java 8

cd D:\Android\sdk ools
android.bat list target
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/android/s
dklib/tool/AvdManagerCli : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

As Larry states, anything you do will be Obscured by the Made With Unity logo under Personal Edition.

Nice help, thanks so much!

If it still does not work try to change folder from SDK: “platforms/android-23” to “platforms/android_23”

no it does damage but i cant get the animation i want to add to play when doing damage.

I had this problem and it took me less than 10 minutes to solve it thanks to you :slight_smile: you made this world a better place to live :smiley:

Hi sorry I thought I was being specific the animation was done in legacy and it does work but im having trouble making the melee script I have play it when i use the button to attack. And it is a first person so im only worried about the weapon animation.

it worked for me thanks a lot

@ augmentedVR THANK YOU

Still having this issue on september 27th 2017. This fixed it for me, but left me with a new issue (and googling says I need newest android SDK to fix it…)

“Failed to Sign APK Package. See console for details”

could you provide a screenshot on how you did it on your inspector and the code structure .

It fixes this problem for me but then I cannot use an API level of 21 which is the minimum for VR. Sooo …I’m stuck.

this issue still exist i cant solve it even with replacement

I see, sr for missed understand, I though you add a new animation into your model, and this animation didn't work while others was fine. hmm, could you provide screenshot how you set your animation character?

It is 2017/10/31, still works! Thank you! @DjangoJG

inside on your if statement try to add this line of code animation.Play("trustSword"); then tell me if it works