Can't package project for Quest2 "Failed to install Android SDK r21b"

Hi guys, I’ve been days trying to test a VR project that I need to deliver on next Monday.
I’ve watched a lot of tutorials, followed the unreal official documentation to install SDK (How to Set Up Android SDK and NDK For Your Unreal Engine Development Environment | Unreal Engine 5.1 Documentation)

And I always get this error, I dont know what else to do.
Someone can help me please?

LogTurnkeySupport: Display: Adding device menu item for DESKTOP-GHHCBJR
LogUObjectHash: Compacting FUObjectHashTables data took 0.30ms
LogTurnkeySupport: Project requires temp target (OpenXR plugin is enabled)
LogLauncherProfile: Unable to use promoted target - C:/UE5 Projects/Zegla_Syngenta_VR/Binaries/Android/UnrealGame.target does not exist.
LogMonitoredProcess: Running Serialized UAT: [ cmd.exe /c "“J:/UE_5.0/Engine/Build/BatchFiles/RunUAT.bat” -ScriptsForProject=“C:/UE5 Projects/Zegla_Syngenta_VR/Zegla_Syngenta_VR.uproject” Turnkey -command=VerifySdk -platform=Android -UpdateIfNeeded -EditorIO -EditorIOPort=50362 -project=“C:/UE5 Projects/Zegla_Syngenta_VR/Zegla_Syngenta_VR.uproject” BuildCookRun -nop4 -utf8output -nocompileeditor -skipbuildeditor -cook -project=“C:/UE5 Projects/Zegla_Syngenta_VR/Zegla_Syngenta_VR.uproject” -unrealexe=“J:\UE_5.0\Engine\Binaries\Win64\UnrealEditor-Cmd.exe” -platform=Android -cookflavor=ASTC -
ddc=InstalledDerivedDataBackendGraph -installed -stage -archive -package -build -compressed -iostore -pak -prereqs -archivedirectory=“I:/Zegla VR project/Zegla_Android_Quest2_Package” -clientconfig=Development" -nocompile ]
UATHelper: Packaging (Android (ASTC)): Running AutomationTool…
UATHelper: Packaging (Android (ASTC)): Parsing command line: -ScriptsForProject=“C:/UE5 Projects/Zegla_Syngenta_VR/Zegla_Syngenta_VR.uproject” Turnkey -command=VerifySdk -platform=Android -UpdateIfNeeded -EditorIO -EditorIOPort=50362 -project=“C:/UE5 Projects/Zegla_Syngenta_VR/Zegla_Syngenta_VR.uproject” BuildCookRun -nop4 -utf8output -nocompileeditor -skipbuildeditor -cook -project=“C:/UE5 Projects/Zegla_Syngenta_VR/Zegla_Syngenta_VR.uproject” -unrealexe=J:\UE_5.0\Engine\Binaries\Win64\UnrealEditor-Cmd.exe -platform=Android -cookflavor=ASTC -ddc=InstalledDerivedDataBackendGraph -installed -st
age -archive -package -build -compressed -iostore -pak -prereqs -archivedirectory=“I:/Zegla VR project/Zegla_Android_Quest2_Package” -clientconfig=Development -nocompile
UATHelper: Packaging (Android (ASTC)): Log location: C:\Users\guilh\AppData\Roaming\Unreal Engine\AutomationTool\Logs\J+UE_5.0\Log.txt
UATHelper: Packaging (Android (ASTC)): Installed Sdk validity:
UATHelper: Packaging (Android (ASTC)): Android: (Status=Invalid, Installed=, AutoSDK=, MinAllowed=r21a, MaxAllowed=r23a, Flags=“Platform_ValidHostPrerequisites”)
UATHelper: Packaging (Android (ASTC)): Will install Android SDK r21b
UATHelper: Packaging (Android (ASTC)): ----------------------------------------------
UATHelper: Packaging (Android (ASTC)): Running ‘J:\UE_5.0\Engine/Extras/Android/SetupAndroid.bat android-28 28.0.3 3.10.2.4988404 21.4.7075529 -noninteractive’
UATHelper: Packaging (Android (ASTC)): ----------------------------------------------
UATHelper: Packaging (Android (ASTC)): ERROR: Command J:\UE_5.0\Engine\Extras\Android\SetupAndroid.bat android-28 28.0.3 3.10.2.4988404 21.4.7075529 -noninteractive failed [Exit code 4, working dir = J:\UE_5.0\Engine\Extras\Android]
PackagingResults: Error: Command J:\UE_5.0\Engine\Extras\Android\SetupAndroid.bat android-28 28.0.3 3.10.2.4988404 21.4.7075529 -noninteractive failed [Exit code 4, working dir = J:\UE_5.0\Engine\Extras\Android]
LogSlate: Window ‘Turnkey’ being destroyed
Message dialog closed, result: No, title: Turnkey, text: Do you want to attempt again?
UATHelper: Packaging (Android (ASTC)): Scanning for envvar changes…
**UATHelper: Packaging (Android (ASTC)): … done! **
UATHelper: Packaging (Android (ASTC)): ----------------------------------------------
UATHelper: Packaging (Android (ASTC)): Finished with 4
UATHelper: Packaging (Android (ASTC)): ----------------------------------------------
UATHelper: Packaging (Android (ASTC)): Failed to install Android SDK r21b
UATHelper: Packaging (Android (ASTC)): Scanning for envvar changes…
**UATHelper: Packaging (Android (ASTC)): … done! **
UATHelper: Packaging (Android (ASTC)): Cleaning Temp Paths…
UATHelper: Packaging (Android (ASTC)): AutomationTool executed for 0h 0m 1s
UATHelper: Packaging (Android (ASTC)): AutomationTool exiting with ExitCode=200 (Error_SDKInstallFailed)
UATHelper: Packaging (Android (ASTC)): BUILD FAILED
PackagingResults: Error: Unknown Error

1 Like

I have the same problem. Did you manage to solve it?

Try to install ndk version r21b using android studio sdk manager, and set up your environment variable NDK_ROOT point to this ndk location. Hope this helps.

Hi there @guileallima, hope you’re well!

This topic has been moved from International to Platform & Builds: Mobile.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing!

Why? Now I’ll never find the answer, these forums are useless.