Search Unity

  1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

[Solved] Android command deprecated, error: Unable to list target platforms

Discussion in 'Android' started by Nabren, Mar 1, 2017.

  1. Nabren

    Nabren

    Joined:
    Mar 7, 2014
    Posts:
    45
    As of today, I just found out that if you install the Android SDK fresh or update the Android SDK, it appears the command "android" has been deprecated:

    The android command is no longer available.
    For manual SDK and AVD management, please use Android Studio.
    For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager

    This prevents Unity from being able to build Android due to the following errors:

    Error:Invalid command android
    CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
    Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.

    I am currently trying to find a workaround, but likely it's going to involve downgrading the SDK tools until Unity supports the new version. I will update here with instructions on how to downgrade when I figure it out, haha!
     
    bradlaronde likes this.
  2. Nabren

    Nabren

    Joined:
    Mar 7, 2014
    Posts:
    45
    Okay, to downgrade:

    SDK Tools Release Notes: https://developer.android.com/studio/releases/sdk-tools.html
    SDK Platform Tools Release Notes: https://developer.android.com/studio/releases/platforms.html

    To download a manual version of SDK Tools, fill in the following url with a version from the above:

    https://dl-ssl.google.com/android/repository/tools_r<version>-windows.zip
    https://dl-ssl.google.com/android/repository/tools_r<version>-macosx.zip

    For me downgrading to https://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zip worked just fine. Once you download an older version the tools, just rename the tools directory at your Android SDK install and replace with the downloaded version.

    I didn't need to downgrade Platform Tools, but if you need to, here are those links as well:

    https://dl-ssl.google.com/android/repository/platform-tools_r<version>-windows.zip
    https://dl-ssl.google.com/android/repository/platform-tools_r<version>-macosx.zip
     
    Last edited: Mar 14, 2017
    pavva94, Ciaran and bradlaronde like this.
  3. cminson

    cminson

    Joined:
    Oct 19, 2015
    Posts:
    2
    Thanks, I hit the same problem. Downgrading fixed it. Such are the travails when dealing with updates.

    However: after switching out the SDK Tools folder, I now get the dreaded "CommandInvocationFailure: Failed to build APK".

    All paths are correct. Package name set, API level set to 24. I'm on Unity 5.6b11. Not sure what else to look at.

    Anyone else hit this problem?
     
  4. Nabren

    Nabren

    Joined:
    Mar 7, 2014
    Posts:
    45
    For me it worked as soon as I downgraded the tools. What version of the SDK Tools did you downgrade to?
     
  5. cminson

    cminson

    Joined:
    Oct 19, 2015
    Posts:
    2
    I downgraded to the version you did (as posted above) - r25.2.5.

    I suspect the issue is that I'm using the Unity Beta and that there's a temporary incompatibility. The beta is unfortunately required for my purposes, as I'm working with the daydream headset.
     
  6. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    333
    Thanks for the Mac Tools folder link, was looking everywhere for it, everyones posts about the problem only mentioned and linked to windows stuff XD

    Fix works for me :
    - Android Studio 2.3
    - Renamed tools folder to tools2
    - pasted the above link tools folder there
     
  7. rootPL

    rootPL

    Joined:
    Sep 5, 2015
    Posts:
    14
    Please consider renaming this topic to:
    "[Solved] Android command deprecated, error: Unable to list target platforms"
    I was looking 2 days for the solution of:
    "Unable to list target platforms", now after I found the solution I see this is already solved here.
     
  8. Nabren

    Nabren

    Joined:
    Mar 7, 2014
    Posts:
    45
    Great suggestion rootPL, done.
     
  9. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    352
    STILL NOT FIXED IN LATEST UNITY

    I installed fresh android studio with latest SDK's,
    I installed fresh JAVA JDK
    Tried 2017.1 and patch 3

    building EMPTY SCENE:
    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_144\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:\Users\PEP\AppData\Local\Android\sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity20171p3\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -


    the 25.2.3 fix worked for me.
     
    Last edited: Aug 13, 2017