Unity3D – Android SDK Tools 升级到26以后构建Apk报错 ( Unable to list target platforms. )

内容目录

错误日志:

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()123456789101112131415

如何解决错误:

下载对应系统的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

原文地址:https://issuetracker.unity3d.com/issues/the-project-does-not-build-on-android-platform-using-the-updated-android-sdk-tools-26-dot-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

发表回复