错误日志:
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="D:/android_sdk\tools" -Dfile.encoding=UTF8 -jar "D:\Program Files\Unity5.5.2p2\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error:Invalid command android
]
stdout[
]
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)
UnityEditor.HostView:OnGUI()
如何解决错误:
下载对应系统的Tools,替换原来SDK下tools的文件夹。
Windows: https://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
Mac OSX: https://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zip
相关错误:
错误描述:[ANDROID] PROJECT FAILS TO BUILD USING THE UPDATED ANDROID SDK TOOLS 26.0 DURING THE MERGING MANIFEST FILES
关键回答:
For me downgrading to revision 25.2.5 worked just fine. Once you download an older version of the tools, if you have android studio installed put these tools in a directory different from the Android SDK directory, then just install the Android SDK Tools, Android SDK Platform-tools, Android SDK Build-tools, the latest API level as described in the tutorial.
Here are the links:
Windows: https://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
Mac OSX: https://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zip