UE5.2.1 Android/Quest 2 Doesn't Package?

UPDATE If I don’t build for arm64, but do build for x86_64, I can build for Android. This doesn’t help me, as I need to install to quest 2, but it might help identify what’s going on.

Hey! So basically I’ve been attempting to package Android for UE5.2 (specifically 5.2.1 source), however I can’t seem to get it to work at all.

I can easily package for 5.1, and I don’t see many topics at all about people having problems with 5.2 so I’m curious if there is a solution.

No matter what configuration I try with Android Studio or the project settings I always freeze up during the compiling NDK phase.

UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Using 'git status' to determine working set for adaptive non-unity build (A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine).
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Android (8490178, based on r450784d) clang version 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Target: x86_64-w64-windows-gnu
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Thread model: posix
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): InstalledDir: C:/Users/Joe/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Android (8490178, based on r450784d) clang version 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Target: x86_64-w64-windows-gnu
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Thread model: posix
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): InstalledDir: C:/Users/Joe/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): NDK toolchain: r25b, NDK version: 250200, ClangVersion: 14.0.6
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Compiling Native 64-bit code with NDK API 'android-26'
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Unhandled exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at EpicGames.Core.FileSystemReference.ContainsName(String name, Int32 offset, Int32 length) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Core\FileSystemReference.cs:line 168
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at EpicGames.Core.FileSystemReference.ContainsName(String name, Int32 offset) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\Shared\EpicGames.Core\FileSystemReference.cs:line 155
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.LinkEnvironment.<>c__DisplayClass68_0.<.ctor>b__0(FileItem x) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\LinkEnvironment.cs:line 447
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at System.Linq.Enumerable.WhereListIterator`1.ToList()
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.LinkEnvironment..ctor(LinkEnvironment Other, UnrealArch OverrideArchitecture) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\System\LinkEnvironment.cs:line 447
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.UEToolChain.LinkAllFiles(LinkEnvironment LinkEnvironment, Boolean bBuildImportLibraryOnly, IActionGraphBuilder Graph) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\ToolChain\UEToolChain.cs:line 125
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.UEBuildBinary.Build(ReadOnlyTargetRules Target, UEToolChain ToolChain, CppCompileEnvironment CompileEnvironment, LinkEnvironment LinkEnvironment, List`1 SpecificFilesToCompile, ISourceFileWorkingSet WorkingSet, DirectoryReference ExeDir, IActionGraphBuilder Graph, ILogger Logger) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildBinary.cs:line 221
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.UEBuildTarget.Build(BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, TargetDescriptor TargetDescriptor, ILogger Logger, Boolean bInitOnly) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 2455
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.BuildMode.CreateMakefile(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet, ILogger Logger) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 882
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.BuildMode.Build(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger, Boolean bSkipPreBuildTargets) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 392
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.BuildMode.Execute(CommandLineArguments Arguments, ILogger Logger) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 248
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 599
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Took 2.6000151000000002s to run dotnet.exe, ExitCode=6
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): UnrealBuildTool failed. See log for more details. (A:\UnrealEngine\UE5\UE_5.2_S\UnrealEngine\Engine\Programs\AutomationTool\Saved\Logs\UBT-ImmersiveClassroom-Android-Development.txt)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool executed for 0h 0m 4s
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=6 (6)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED

If anyone is packaging for Android in UE5.2, it would really help me out if you told me what JDK/NDK/SDK/Build Tools you are using. If you provide screenshots of the SDK manager and the Android SDK screen of the project settings I’d be very appreciative!

Hey there, I think I ran into the same issue, here is a link

In my case I’m finding that switching engine version down to 5.1 allows me to build for android and I don’t get any IndexOutOfRangeException in the FileSystemReference.cs, yay. This must be an issue introduced in UE5.2 / UE5.2.1

I’ve been trying to figure it out for 2 days, just to realize all the exact same settings on the Launcher Binary Engine works just fine. So it’s something to do with specifically using source.

Hi guys!
I also ran into this problem and decided to look at the source code of the UE.

@cazeoj @Ethan_Sherr @RealAero
SOLUTION:
Do not use the “A” disk volume for the project.
Use some other one.
For example, “C”.

A little more detail:
In my case, the engine and SDK were on disk volume B.
And the project was on the disk volume A.

The problem is that the UE is trying to find the folder “a” in the path “A:/…/EmptyVR_5_3_1/Intermediate/Build/Android/a/…”.
As a result, he finds the first “a” in the path (which is actually a disk volume), tries to process it, but an mistake is made in the code and the build completes with an unexpected error.

I have already reported the error to the Epic, but for now, just use a different disk volume for your projects.

Good luck!

1 Like



This is for Quest 2

sdk 32

For Android Phones use API level 33.

1 Like