gpt4 book ai didi

android - unity : Build failure, 无法更新SDK

转载 作者:行者123 更新时间:2023-12-04 23:52:40 26 4
gpt4 key购买 nike

Unity 最新更新 2018.3
根据 SDK 管理器更新的 SDK 工具和平台。
正在尝试构建和运行 Android build设置。

更新 SDK 后,Unity 仍然要求我通过按下软件内置的按钮来更新 SDK。在我这样做之后,它告诉我:

Unable to update the SDK. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed. See console log for details.

当我查看控制台时,它告诉我:

CommandInvokationFailure: Unable to update the SDK. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed. 
C:\Program Files (x86)\Android\android-sdk\tempToolsDir\bin\sdkmanager.bat --sdk_root=C:\Program Files (x86)\Android\android-sdk tools platform-tools "build-tools;28.0.3"

stderr[
Error: Failed to find package Files
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[

]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEditor.Android.Command.RunWithStdin (System.Diagnostics.ProcessStartInfo psi, System.String errorMsg, System.Collections.Generic.IEnumerable`1[T] input) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEditor.Android.AndroidSDKTools.RunAndroidSdkTool (System.String toolName, System.String arguments, System.Boolean updateCommand, System.String errorMsg, System.String toolsDir) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEditor.Android.AndroidSDKTools.UpdateSDK (UnityEditor.Android.AndroidJavaTools javaTools) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Update (UnityEditor.Android.AndroidSDKTools sdkTools, UnityEditor.Android.AndroidJavaTools javaTools, System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (UnityEditor.Android.AndroidJavaTools javaTools, System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector detector) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

我手动更新了 SDK,它也给了我一个错误。我修复了这个技巧:
Can't update \tools - Android SDK Command Line Tools for Windows

无论如何,我用管理员运行 Unity,我用管理员运行 cmd 进行手动更新,但它仍然无法构建。需要帮助,谢谢。

SCREENSHOT: Unity SDK Update for Android build

最佳答案

我在尝试更新我的 android sdk 并通过手动运行 sdk 管理器修复它时遇到了类似的问题。在我的 Unity Editor 控制台中,它打印出一份长许可协议(protocol)以及告诉我该怎么做的错误。

首先,如果它不存在,请在您的 .android 文件夹中创建一个空的 repositories.cfg 文件。对我来说,该文件位于 C:\Users\myuser\.android

接下来,像这样在命令提示符下运行 sdkmanager.bat(您的结果和路径可能因您的 Unity 版本而异)。

"C:\Program Files\Unity\Hub\Editor\2019.2.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat"  "platforms;android-29"

然后我可以按 y 并接受许可。

关于android - unity : Build failure, 无法更新SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54010590/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com