I’ve been trying to build my game so I can release an update, but I just cannot get it to compile this time around, I get the following error below, the SDK is there and android studio finds it ok, Now a couple of days ago 17th I did update the SDK and Android Studio, I bet this is where the problem is, can anybody PLEASE help to get this sorted, it’s driving me crazy.
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_111\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“D:/Android-Studio-SDK\tools” -Dfile.encoding=UTF8 -jar “C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” -
stderr[
Error:Invalid command android
]
stdout[
]
exit code: 64
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[ ] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[ ] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
I did find the answer/a work around here Answer , but I would like to find a proper fix, I’m sure the unity boffins know what the answer is, or does anybody else know??
That workaround is currently your best solution. One of the latest android SDK updates deprecated a command line tool that Unity’s build process was using i guess.
If you have this upgraded Android SDK, you will get this error.
The workaround was to forcefully downgrade your Android SDK to the older, working version. Unity devs are probably aware of this issue and will issue a fix in an upcoming release (if not already released a fix).
1 Like
@liortal
Cheers, no fix as of yet I’m running version 5.5.2p3, upgrading is sometimes more hassle than it worth, I’m glad the work around works though, my update has been publish yesterday 
I’ve just upgraded to Unity 5.6.0f3 and am still getting this same issue. Anyone know if its supposed to have been fixed by now?
I can give you a very simple workaround 
The problem is that the ‘android’ command returns an exit code of ‘64’ (they print a warning that its deprecated or something like that). The tool still exists, but Unity treats it as though it doesn’t properly work.
So, Instead of installing an older version of the Android tools, you can create a ‘wrapper’ android.exe command.
Internally, it will just call the real ‘android’ command and mask its return code (return 0).
Very simple , it can be done in literally 2 minutes work.
@liortal
I would be interested in this fix, by now Unity should of fixed this issue, fire way please!!
I have no idea if they are aware of it (probably yes, as many people complained about it already).
@Yury-Habets is there a bug report for this?