I keep getting an Array too Large error on ASTC build

Hey all, so ive got an interesting building issue and searches dont seem to be able to tell me much. I have a very basic VR program Im trying to package up into a proper APK so I can load it up directly onto my quest 2/3. However every time I build it always failed with the error “Required Array Size too Large”
Originally this project was done on 4.26, however trying to package up the APK on that was a nightmare of trying to figure out different versions for andriod spk and java. So I decided to convert the scene into 5.3 and have been running it there. It works fine when tethered and run directly in unreal. I know its been built before successfully into an apk when it was on 4.26 but it cant seem to compile now. As a side note I know theres a 2gb limit to andriod packages, when I checked the build folders in the unreal directory and all the main assets are 2gb and under but I found 2 files that are 2.5gb exactly, dunno what these files are or if that matters but including that info just in case:
[Unreal Project Directory]\Intermediate\Android\arm64\gradle\app\src\main\assets\main.obb.png
[Unreal Project Directory]\IndieAtlanticTest10 5.3\Saved\StagedBuilds\Andriod_ASTC.obb

Ill post the logs below, if anyone knows what I can do to fix this or any steps I could take to help figure it out that would be much appreciated! Thank you

UATHelper: Packaging (Android (ASTC)): ====6/9/2024 2:49:32 PM====PERFORMING FINAL APK PACKAGE OPERATION=====arm64===========================================
UATHelper: Packaging (Android (ASTC)): Copying W:\Unreal Engine\IndieAtlanticTest10 5.3\Intermediate\Android\arm64\AndroidManifest.xml to W:\Unreal Engine\IndieAtlanticTest10 5.3\Intermediate\Android\arm64\gradle\app\src\main\AndroidManifest.xml
UATHelper: Packaging (Android (ASTC)): Directory Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServer/…/AFSStub copied to W:/Unreal Engine/IndieAtlanticTest10 5.3/Intermediate/Android/arm64/gradle/AFSProject (True)
UATHelper: Packaging (Android (ASTC)): Directory Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServer/Android copied to W:/Unreal Engine/IndieAtlanticTest10 5.3/Intermediate/Android/arm64/gradle/AFSProject/app/src/main (True)
UATHelper: Packaging (Android (ASTC)): Directory W:/Unreal Engine/IndieAtlanticTest10 5.3/Intermediate/Android/arm64/gradle/app/src/main/res copied to W:/Unreal Engine/IndieAtlanticTest10 5.3/Intermediate/Android/arm64/gradle/AFSProject/app/src/main/res (True)
UATHelper: Packaging (Android (ASTC)): Directory W:/Unreal Engine/IndieAtlanticTest10 5.3/Intermediate/Android/arm64/gradle/gradle copied to W:/Unreal Engine/IndieAtlanticTest10 5.3/Intermediate/Android/arm64/gradle/AFSProject/gradle (True)
UATHelper: Packaging (Android (ASTC)): Fixing minSdkVersion; NDK level is 33 which is above minSdkVersion 29.
UATHelper: Packaging (Android (ASTC)): Fixing targetSdkVersion; minSdkVersion is 33 which is above targetSdkVersion 30.
UATHelper: Packaging (Android (ASTC)): Creating rungradle.bat to work around commandline length limit (using unused drive letter Z:)
UATHelper: Packaging (Android (ASTC)): Making .apk with Gradle…
UATHelper: Packaging (Android (ASTC)): To honour the JVM settings for this build a single-use Daemon process will be forked. See The Gradle Daemon.
UATHelper: Packaging (Android (ASTC)): Daemon will be stopped at the end of the build
UATHelper: Packaging (Android (ASTC)): > Task :app:preBuild UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :app:preDebugBuild UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :app:cleanPackageDebug UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:preBuild UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:preDebugBuild UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:compileDebugAidl NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:preBuild UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:preDebugBuild UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:compileDebugAidl NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:packageDebugRenderscript NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:packageDebugRenderscript NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :app:compileDebugRenderscript NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :app:generateDebugBuildConfig
UATHelper: Packaging (Android (ASTC)): > Task :app:generateDebugResValues
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:compileDebugRenderscript NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:writeDebugAarMetadata
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:writeDebugAarMetadata
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:generateDebugResValues
UATHelper: Packaging (Android (ASTC)): > Task :app:javaPreCompileDebug
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:generateDebugResources
UATHelper: Packaging (Android (ASTC)): > Task :app:checkDebugAarMetadata
UATHelper: Packaging (Android (ASTC)): > Task :app:compileDebugAidl
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:packageDebugResources
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:compileDebugRenderscript NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:generateDebugResValues
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:generateDebugResources
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:packageDebugResources
UATHelper: Packaging (Android (ASTC)): > Task :app:mapDebugSourceSetPaths
UATHelper: Packaging (Android (ASTC)): > Task :app:generateDebugResources
UATHelper: Packaging (Android (ASTC)): > Task :app:createDebugCompatibleScreenManifests
UATHelper: Packaging (Android (ASTC)): > Task :app:extractDeepLinksDebug
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:extractDeepLinksDebug
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:extractDeepLinksDebug
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:processDebugManifest
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:compileDebugLibraryResources
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:generateDebugBuildConfig
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:javaPreCompileDebug
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:generateDebugBuildConfig
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:javaPreCompileDebug
UATHelper: Packaging (Android (ASTC)): > Task :app:mergeDebugShaders
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:parseDebugLocalResources
UATHelper: Packaging (Android (ASTC)): > Task :app:compileDebugShaders NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:compileDebugLibraryResources
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:parseDebugLocalResources
UATHelper: Packaging (Android (ASTC)): > Task :app:generateDebugAssets UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:mergeDebugShaders
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:compileDebugShaders NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:generateDebugAssets UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:packageDebugAssets
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:mergeDebugShaders
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:compileDebugShaders NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:generateDebugAssets UP-TO-DATE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:packageDebugAssets
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:processDebugManifest
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:generateDebugRFile
UATHelper: Packaging (Android (ASTC)): > Task :app:mergeDebugResources
UATHelper: Packaging (Android (ASTC)): > Task :app:mergeDebugAssets
UATHelper: Packaging (Android (ASTC)): > Task :app:processDebugMainManifest
UATHelper: Packaging (Android (ASTC)): > Task :app:processDebugManifest
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:generateDebugRFile
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:compileDebugJavaWithJavac
UATHelper: Packaging (Android (ASTC)): Note: Z:\permission_library\src\main\java\com\google\vr\sdk\samples\permission\PermissionFragment.java uses or overrides a deprecated API.
UATHelper: Packaging (Android (ASTC)): Note: Recompile with -Xlint:deprecation for details.
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:compileDebugJavaWithJavac
UATHelper: Packaging (Android (ASTC)): > Task :app:processDebugJavaRes NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:processDebugJavaRes NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:bundleLibResDebug NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:processDebugJavaRes NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:bundleLibResDebug NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:bundleLibCompileToJarDebug
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:bundleLibCompileToJarDebug
UATHelper: Packaging (Android (ASTC)): > Task :app:desugarDebugFileDependencies
UATHelper: Packaging (Android (ASTC)): > Task :app:compressDebugAssets FAILED
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:bundleLibRuntimeToDirDebug
UATHelper: Packaging (Android (ASTC)): > Task :app:processDebugManifestForPackage
UATHelper: Packaging (Android (ASTC)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ASTC)): * What went wrong:
UATHelper: Packaging (Android (ASTC)): Execution failed for task ‘:app:compressDebugAssets’.
UATHelper: Packaging (Android (ASTC)): > Task :app:checkDebugDuplicateClasses
UATHelper: Packaging (Android (ASTC)): > A failure occurred while executing com.android.build.gradle.internal.tasks.CompressAssetsWorkAction
UATHelper: Packaging (Android (ASTC)): > Required array size too large
UATHelper: Packaging (Android (ASTC)): * Try:
UATHelper: Packaging (Android (ASTC)): > Run with --stacktrace option to get the stack trace.
UATHelper: Packaging (Android (ASTC)): Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
UATHelper: Packaging (Android (ASTC)): You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
UATHelper: Packaging (Android (ASTC)): > Run with --info or --debug option to get more log output.
UATHelper: Packaging (Android (ASTC)): See Command-Line Interface
UATHelper: Packaging (Android (ASTC)): 47 actionable tasks: 46 executed, 1 up-to-date
UATHelper: Packaging (Android (ASTC)): > Run with --scan to get full insights.
UATHelper: Packaging (Android (ASTC)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ASTC)): BUILD FAILED in 2m 4s
UATHelper: Packaging (Android (ASTC)): cmd.exe failed with args /c “W:\Unreal Engine\IndieAtlanticTest10 5.3\Intermediate\Android\arm64\gradle\rungradle.bat” :app:assembleDebug
UATHelper: Packaging (Android (ASTC)): (see C:\Users\sethl\AppData\Roaming\Unreal Engine\AutomationTool\Logs\G+Unreal+Epic+Games+UE_5.3\Log.txt for full exception trace)
UATHelper: Packaging (Android (ASTC)): AutomationTool executed for 0h 10m 48s
UATHelper: Packaging (Android (ASTC)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ASTC)): BUILD FAILED
PackagingResults: Error: Unknown Error

Hi, I have the same issue, did you figure it out?
Thanks!

I’m also running into this. Not finding answers online

For me unchecking “Package game data inside .apk?” in project settings fixed this issue. It generates the .obb separately but doesn’t return the error. For Quest you can use the Meta Quest Developer Hub to install the apk/obb

2 Likes