androidunity-game-enginesdkandroid-sdk-toolsandroid-sdk-manager

Unity: Build failure, unable to update the SDK


Unity Latest update 2018.3
SDK Tools and Platforms up to date according to SDK Manager.
Trying to build and run Android Build Settings.

After updating the SDK, Unity still asks me to update the SDK by pressing a button built into the software. After I do this it tells me:

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.

When I take a look at the console, it tells me:

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)

I have updated the SDK manually, it also gave me an error there. I fixed it doing this trick:
Can't update \tools - Android SDK Command Line Tools for Windows

Anyway, I ran Unity with administrator, I ran the cmd with administrator for the manual updates and yet it still wont build. Help needed, thanks.

SCREENSHOT: Unity SDK Update for Android build


Solution

  • Try installing Android SDK into some folder that does not require administrator priviledges to access (something like C:\SDKs\android-sdk). It worked for me.