Build fails with "Invalid command and android" after upgrading Android SDK Tools to latest (25.3.1)

To reproduce:
0. Use the Android SDK Manager to update to the latest Android SDK Tool (25.3.1)
Note 25.3.0 removed ‘android’ and other deprecated command lines tools used by Unity build process.
See SDK Tools release notes  |  Android Studio  |  Android Developers

  1. Set your Unity project build platform to ‘Android’
  2. Click ‘Build’

EXPECTED:
Unity generates and APK

ACTUAL:

  1. Error popup dialog:

Error:Invalid command android
UnityEditor.HostView:OnGUI()

  1. Console error messages (OSX shown here):

CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“/Users/userid/Library/Android/sdk/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity-5.6.0b11/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar” -

stderr[
Error:Invalid command android
]
stdout[

]

Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“/Users/userid/Library/Android/sdk/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity-5.6.0b11/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar” -

stderr[
Error:Invalid command android
]
stdout[

]
exit code: 64

VERIFIED USING:
Unity 5.6.0b11
Android SDK Tools 25.3.1

WORKAROUND:
Manually downgrade to pre-25.3.0 Android SDK Tools

2 Likes

Looks like this issue is also described here:

Also, some of the March 2017 comments in this thread appear to be the same issue (although the original report of a problem was more likely due to incorrect settings of Android SDK path):

And here’s the issue in the Android issue tracker:
https://code.google.com/p/android/issues/detail?id=235455

Hi fredsa,
Thank you for your report. We know about this issue. You can follow the resolution process here:

In the meantime, please downgrade your SDK tools to version 25.2 to avoid this.

1 Like