How to properly set up UE5 for Android development

Hi!

Possibly a noob question. Totally new to UE, but not to development. I am unable to set up my project to run on an Android phone. I’m running UE 5.03 on a Mac (Monterey 12.6) and I have Android Studio set up (I’m quite confident it is set up properly as I’m using it daily for my other mobile projects).

I have the SDK, NDK and JDK installed. However, nothing shows up in the “Installed SDK” line in the launcher menu (Platforms → Android), and there’s a triangular warning icon next to the Android platform in that menu.

I’ve tried using the turnkey tool to set up the SDK, however I am unable to get it to work.

Here’s what it outputs when I click “Refresh platform status”:

LogTurnkeySupport: Turnkey Platform: Android: (Status=Invalid, Installed=, AutoSDK=, MinAllowed=r21a, MaxAllowed=r23a, Flags=“Platform_InvalidHostPrerequisites”)
LogTurnkeySupport: Turnkey Platform: IOS: (Status=Valid, Installed=13.4.1, AutoSDK=, MinAllowed=11.0.0, MaxAllowed=13.9.9, Flags=“InstalledSdk_ValidVersionExists”)
LogTurnkeySupport: Turnkey Platform: Mac: (Status=Valid, Installed=13.4.1, AutoSDK=, MinAllowed=11.0.0, MaxAllowed=13.9.9, Flags=“InstalledSdk_ValidVersionExists”)

And this is the output of ‘turnkey -command=ListPlatforms’ (skipping the non-Android related parts)
UATHelper: Turnkey (): Platform Information:

UATHelper: Turnkey (): Platform: Android
UATHelper: Turnkey (): Installed Manual Sdk:
UATHelper: Turnkey (): Installed Auto Sdk:
UATHelper: Turnkey (): Allowed Sdk Range: r21a-r23a
UATHelper: Turnkey (): Valid Manual SDK Installed? False
UATHelper: Turnkey (): Valid Auto SDK Installed? False
UATHelper: Turnkey (): AllVersions Installed:
UATHelper: Turnkey (): Possible Full Sdks that could be installed:
UATHelper: Turnkey (): Name: Android SDK r21b
UATHelper: Turnkey (): Version: r21b
UATHelper: Turnkey (): Platform: Android
UATHelper: Turnkey (): Type: Full
UATHelper: Turnkey (): Installers:
UATHelper: Turnkey (): Allowed Device Software Range: -
UATHelper: Turnkey (): Devices:
UATHelper: Turnkey (): NO DEVICES FOUND!

The last line is puzzling to me as I am actually seeing my phone in the device manager and it shows up in the launcher menu (though also with the warning icon and no SDK detected).

Finally, when I run ‘turnkey -command=InstallSdk -platform=Android’ I get this:

LogMonitoredProcess: Running Serialized UAT: [ /usr/bin/env – “/Users/Shared/Epic Games/UE_5.0/Engine/Build/BatchFiles/RunUAT.command” Turnkey -EditorIO -EditorIOPort=63577 -unrealexe=“/Users/Shared/Epic Games/UE_5.0/Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor” -command=InstallSdk -platform=Android -nocompile ]
UATHelper: Turnkey (): Running AutomationTool…
UATHelper: Turnkey (): Running bundled mono, version: Mono JIT compiler version 5.16.0.220 (2018-06/bb3ae37d71a Fri Nov 16 17:12:11 EST 2018)
UATHelper: Turnkey (): Setting up bundled DotNet SDK
UATHelper: Turnkey (): Start UAT Non-Interactively: ./AutomationTool Turnkey -EditorIO -EditorIOPort=63577 -unrealexe=/Users/Shared/Epic Games/UE_5.0/Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor -command=InstallSdk -platform=Android -nocompile
UATHelper: Turnkey (): Parsing command line: Turnkey -EditorIO -EditorIOPort=63577 -unrealexe=“/Users/Shared/Epic Games/UE_5.0/Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor” -command=InstallSdk -platform=Android -nocompile
UATHelper: Turnkey (): Using xbuild. Install Mono 5.0 or greater for faster builds!
UATHelper: Turnkey (): Log location: /Users/levtyrnov/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt
LogSlate: Window ‘Turnkey’ being destroyed
LogSlate: Window ‘Turnkey’ being destroyed
UATHelper: Turnkey (): ERROR: Failed to update host prerequisites
UATHelper: Turnkey (): Cleaning Temp Paths…
UATHelper: Turnkey (): BUILD SUCCESSFUL
UATHelper: Turnkey (): AutomationTool executed for 0h 0m 12s
UATHelper: Turnkey (): AutomationTool exiting with ExitCode=0 (Success)

I have not been able to find any information regarding this error message:

ERROR: Failed to update host prerequisites

Could somebody point me in the right direction? Am I doing the wrong thing altogether? Any help is greatly appreciated.

you should be installing the sdk and ndk from within android studio using the sdk manager

I dev for quest
for that I specifically have to use android studio 4, jre 8, jdk 8, ndk 21b-e, sdk29/30
and dotnet 3.51
I am not on a mac.
but
for me
for the quest
newer android studios don’t work
if you have the sdk/ndk installed and jdk
you can put the paths in project prefs android
by hand

1 Like

Hi! Thanks for the reply!

I tried installing SDK and NDK through Android Studio first, and setting the paths in UE manually. But I had the same results =[

I am using a newer Android Studio, though, and JDK 19 (the latest). Can somebody chime in on using these newer versions, please? Is it entirely impossible to have it working with the recent AS and Java? My other non-UE projects are already tied into the new AS, and downgrading would surely be a pain…

I don’t think it works with the new ANDROID STUDIO
This is what I am saying
when Unreal compiles for android it uses gradle
which is inside android studio
the unreal tools are sending android 4 commands
and they are looking for symbols and debugging tools inside of JDK 8 and both those sets of tools require jre 8

The tools in ue were written with AS 4 and JDK 8 in JRE 8.

If you want to dev for a quest in unity it is the same, you must use 2019f not 2022.

I see. Thanks for clueing me in. I guess I’ll have to set up another machine for UE specifically.

I don’t think they are exclusive
I think you can put android studio 4 on a machine with the latest android
but you have to have jre 8 running
the jdk, ndk, and sdk are just libraries and tools
if you have an ndk/sdk already installed you can redirect

1 Like

I’m a bit paranoid that installing another AS side-by-side might mess up environment variables and whatever other settings that affect the build of my current projects.

1 Like