Android SDK Tools 升級到26以後構建Apk報錯 ( Unable to list target platforms. )
阿新 • • 發佈:2019-01-28
錯誤日誌:
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的資料夾。
相關錯誤:
錯誤描述:[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: