Unity3d 5.5.0fx Unable to list target platforms error

Hi. I got the error “Unable to list target platforms” whenever I try to build app for android in ubuntu 14.04


Error building Player:CommandInvokationFailure:Unable to list target platforms.Please make sure the android sdk path is correct.See the Consolefor more details./usr/lib/jvm/java-8-oracle/bin/java -Xmx2048M-Dcom.android.sdkmanager.toolsdir=“/home/yeol/AndroidSDK/tools”-Dfile.encoding=UTF8 -jar “/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar”-

stderr[Exception in thread “main” java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at SDKMain.main(SDKMain.java:129)Caused by: java.lang.NoSuchMethodError: com.android.sdklib.ISystemImage.getTag()Lcom/android/sdklib/repository/descriptors/IdDisplay;
at com.android.sdklib.SystemImage.compareTo(SystemImage.java:278)
at com.android.sdklib.SystemImage.compareTo(SystemImage.java:37)
at java.util.TreeMap.compare(TreeMap.java:1294)
at java.util.TreeMap.put(TreeMap.java:538)
at java.util.TreeSet.add(TreeSet.java:255)
at com.android.sdklib.repository.local.LocalPlatformPkgInfo.getPlatformSystemImages(LocalPlatformPkgInfo.java:362)
at com.android.sdklib.repository.local.LocalPlatformPkgInfo.createAndroidTarget(LocalPlatformPkgInfo.java:248)
at com.android.sdklib.repository.local.LocalPlatformPkgInfo.getAndroidTarget(LocalPlatformPkgInfo.java:104)
at com.android.sdklib.repository.local.LocalSdk.getTargets(LocalSdk.java:712)
at com.android.sdklib.SdkManager.getTargets(SdkManager.java:181)
at com.android.sdkmanager.Main.displayTargetList(Main.java:968)
at com.android.sdkmanager.Main.doAction(Main.java:318)
at com.android.sdkmanager.Main.run(Main.java:151)
at com.android.sdkmanager.Main.main(Main.java:117)…5 more
]


I checked the SDK path but It was right. Also I reinstalled all of android-sdk to resolve the problem
but It was failed.
SDK-tools-version is rev 25.2.4 and sdk-platform tools are 25.0.2
jdk version is 8u111

Is there any compatible issue to use unity3d editor for linux ?
Please let me know how to solve the problem !

2 Likes

A user reported that downgrading sdk tools to 25.2.2 resolves the issue for him/her. We haven’t been able to reproduce this here in order to fix it, so any information you can provide could be helpful.

If you run that command in the console, do you get the same error?
(/usr/lib/jvm/java-8-oracle/bin/java -Xmx2048M-Dcom.android.sdkmanager.toolsdir="/home/yeol/AndroidSDK/tools"-Dfile.encoding=UTF8 -jar "/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar")

MacBook-Air:~ hongchunhui$ /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“/Users/hongchunhui/Library/Android/sdk/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar”
Error:Usage: sdktools | - (read arguments from stdin)

I also encountered this problem

Got the same error, after upgrading Android SK Tools to 25.3.1

Downgrading to 25.2.2 solution works. Thanks a lot for help!

Same error has today in Eclipse and now in Unity.
Found great solution from distributor:

  1. just open Télécharger Android Studio et les outils pour les applications – Développeurs Android  |  Android Studio  |  Android Developers

  2. scrolldown to the bottom of that page

  3. find Windows “tools_r25.2.3-windows.zip”
    download and unzip it

  4. remove and replace your folder “SDK” + “/tools”

  5. Enjoy!

  6. By “SDK Manager” do upgrade to 25.2.5

  7. Now works all: Eclipse, Android Studio, Unity.
    Enjoy again!

57 Likes

This is the problem:

They just removed the “android” command with the new update. Rolling back works.

2 Likes

PiedLove_com, thank you! It works!

Thanks a lot man!!!

You are a nice man!! I love you!!

Can we get this remedied?

Same here please I’m also Android Dev and I cannot just downgrade the tools. Is there any other workaround or fix?

2 Likes

Thanks bro… it works :smile:

I’d like to add that this worked for me as well. Thanks!!

(Note that I had tried rolling back to having 24 installed only while removing 25 completely (which took awhile for me). And I still received the same error message.) But after removing and replacing just the Tools folder as stated above, it was able to continue the build.

To reference something else mentioned in this post: https://answers.unity3d.com/questions/1320634/unable-to-list-target-platforms-when-i-try-to-buil.html?sort=votes

I stopped getting the error “Invalid command android” too once I removed and replaced the contents of the Tools folder.

I met the same problem, it happend when I upgrade my android SDK by using Android Studio.
It seems Unity does not supppot Android SDK tools 25.3.1, which change the command “android.bat”.
I have to downgrade to the r25.2.3~
When will unity support the newest version of Android SDK, the Unity 5.5.2p3 is still the same.

2 Likes

Running into this same issue on mac with unity 5.5.2f1, and android sdk tools 25.0.2. I’m with ianholing and watsonsong, is there an update coming to unity to fix this?

1 Like

I just copied the SDK to another location and downgraded it there specifically for use with Unity while leaving the original copy (used by Android Studio) intact and updated

Thanks!!!