Android deployment error

Hi everyone,

I’m trying to deploy a little game that i’m making for Android, but when Unity is building it fails listing the target platforms, and the console show me a “NoSuchMethodError” on com.android.sdklib.AndroidVersion.(Ljava/util/Properties;)V

I’m on Ubuntu 14.04LTS, i have Android Studio installed in my home folder with all APIs after 19 (using min. 21 in player settings) and oracle java 8 and 7 in /usr/lib, if that matters

Someone knows why is happening and if it is have any solution? lot of thx in advance ^^

Regards.

Hi!

I have a similar problem:

Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
/usr/lib/jvm/default/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/opt/android-sdk/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(Native Method)
    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:322)
    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
]
stdout[

]
exit code: 1

I am working on ArchLinux and tried to install all variations of jdk and openjdk 7/8 and Android APIs.
Thanks for help

That’s odd - what happens if you manually run ./android list target -c from your sdk tools directory?

I get the following list:

  • android-23
  • android-24
  • android-25
  • Google Inc.:Google APIs:23
  • Google Inc.:Google APIs:24

This is my list:

  • android-16
  • android-17
  • android-18
  • android-19
  • android-20
  • android-21
  • android-22
  • android-23
  • android-24
  • android-25
  • Google Inc.:Google APIs:16
  • Google Inc.:Google APIs:17
  • Google Inc.:Google APIs:18
  • Google Inc.:Glass Development Kit Preview:19
  • Google Inc.:Google APIs:19
  • Google Inc.:Google APIs:21
  • Google Inc.:Google APIs:22
  • Google Inc.:Google APIs:23
  • Google Inc.:Google APIs:24

I solved the problem by downgrading the Android SDK tools to Rev. 25.2.2. Now the build works again:) But it would be nice that Unity Editor could operate with Rev. 25.2.3

The motherboard of my laptop got burnt a week ago because the “openGL + NVidia” bug on Ubuntu so i won’t be able to use the Linux Editor in a while :frowning:

I’ll keep an eye on the forum in the meantime, also i take note of the downgrade workaround for later. thx for all!

1 Like

Hi,

I’ve had the same problem with Android SDK tools Rev 25.2.4, downgrading to 25.2.2 solved the issue.

For the least experienced:

2 Likes