Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Android deployment error

Discussion in 'Linux Editor' started by Gekokeitaro, Dec 3, 2016.

  1. Gekokeitaro

    Gekokeitaro

    Joined:
    May 29, 2016
    Posts:
    5
    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.<init>(Ljava/util/Properties\;)V

    Screenshot from 2016-12-03 01:06:43.png

    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.
     
    Last edited: Dec 3, 2016
  2. zinggpa

    zinggpa

    Joined:
    Jun 10, 2016
    Posts:
    3
    Hi!

    I have a similar problem:

    Code (CSharp):
    1. Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
    2. /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" -
    3.  
    4. stderr[
    5. Exception in thread "main" java.lang.reflect.InvocationTargetException
    6.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    7.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    8.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    9.     at java.lang.reflect.Method.invoke(Method.java:498)
    10.     at SDKMain.main(SDKMain.java:129)
    11. Caused by: java.lang.NoSuchMethodError: com.android.sdklib.ISystemImage.getTag()Lcom/android/sdklib/repository/descriptors/IdDisplay;
    12.     at com.android.sdklib.SystemImage.compareTo(SystemImage.java:278)
    13.     at com.android.sdklib.SystemImage.compareTo(SystemImage.java:37)
    14.     at java.util.TreeMap.compare(TreeMap.java:1294)
    15.     at java.util.TreeMap.put(TreeMap.java:538)
    16.     at java.util.TreeSet.add(TreeSet.java:255)
    17.     at com.android.sdklib.repository.local.LocalPlatformPkgInfo.getPlatformSystemImages(LocalPlatformPkgInfo.java:322)
    18.     at com.android.sdklib.repository.local.LocalPlatformPkgInfo.createAndroidTarget(LocalPlatformPkgInfo.java:248)
    19.     at com.android.sdklib.repository.local.LocalPlatformPkgInfo.getAndroidTarget(LocalPlatformPkgInfo.java:104)
    20.     at com.android.sdklib.repository.local.LocalSdk.getTargets(LocalSdk.java:712)
    21.     at com.android.sdklib.SdkManager.getTargets(SdkManager.java:181)
    22.     at com.android.sdkmanager.Main.displayTargetList(Main.java:968)
    23.     at com.android.sdkmanager.Main.doAction(Main.java:318)
    24.     at com.android.sdkmanager.Main.run(Main.java:151)
    25.     at com.android.sdkmanager.Main.main(Main.java:117)
    26.     ... 5 more
    27. ]
    28. stdout[
    29.  
    30. ]
    31. 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
     
  3. Tak

    Tak

    Unity Technologies

    Joined:
    Mar 8, 2010
    Posts:
    935
    That's odd - what happens if you manually run ./android list target -c from your sdk tools directory?
     
  4. zinggpa

    zinggpa

    Joined:
    Jun 10, 2016
    Posts:
    3
    I get the following list:
    • android-23
    • android-24
    • android-25
    • Google Inc.:Google APIs:23
    • Google Inc.:Google APIs:24
     
  5. Gekokeitaro

    Gekokeitaro

    Joined:
    May 29, 2016
    Posts:
    5
    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
     
  6. zinggpa

    zinggpa

    Joined:
    Jun 10, 2016
    Posts:
    3
    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
     
  7. Gekokeitaro

    Gekokeitaro

    Joined:
    May 29, 2016
    Posts:
    5
    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 :(

    I'll keep an eye on the forum in the meantime, also i take note of the downgrade workaround for later. thx for all!
     
    donmetapod likes this.
  8. nagyv

    nagyv

    Joined:
    Dec 22, 2016
    Posts:
    4
    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:

    - download Android SDK tools Rev 25.2.2 from http://dl-ssl.google.com/android/repository/tools_r25.2.2-linux.zip
    - locate your Android SDK folder
    - rename the tools folder to tools.bak (for backup, in case something goes wrong)
    - extract the contents of the zip file to your SDK folder
     
    donmetapod and Sensics like this.