ERROR: cmd.exe failed with args when packaging for android (Quest 2)

Hey guys,

Recently tried switching from Unity to UE5 for VR development, but the transition has anything but smooth. I’ve been stuck with this for a couple of days now and I thought I’d see if the great hive mind has a solution for me. I’m can cook my content just fine, however when I try to package it into an APK I get the following message:

UATHelper: Packaging (Android (ASTC)): > Task :app:mergeDebugJniLibFolders
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:mergeDebugJniLibFolders
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:mergeDebugJniLibFolders
UATHelper: Packaging (Android (ASTC)): > Task :app:mergeLibDexDebug
UATHelper: Packaging (Android (ASTC)): > Task :app:ueDeleteOldPackageDebug
UATHelper: Packaging (Android (ASTC)): > Task :app:validateSigningDebug
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:mergeDebugNativeLibs
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:stripDebugDebugSymbols NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :permission_library:copyDebugJniLibsProjectOnly
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:mergeDebugNativeLibs
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:stripDebugDebugSymbols NO-SOURCE
UATHelper: Packaging (Android (ASTC)): > Task :downloader_library:copyDebugJniLibsProjectOnly
UATHelper: Packaging (Android (ASTC)): > Task :app:mergeProjectDexDebug
UATHelper: Packaging (Android (ASTC)): > Task :app:mergeDebugNativeLibs
UATHelper: Packaging (Android (ASTC)): > Task :app:stripDebugDebugSymbols
UATHelper: Packaging (Android (ASTC)): > Task :app:packageDebug FAILED
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:packageDebug’.
UATHelper: Packaging (Android (ASTC)): > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
UATHelper: Packaging (Android (ASTC)): > java.lang.OutOfMemoryError (no error message)
UATHelper: Packaging (Android (ASTC)): * Try:
UATHelper: Packaging (Android (ASTC)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
UATHelper: Packaging (Android (ASTC)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ASTC)): 58 actionable tasks: 58 executed
UATHelper: Packaging (Android (ASTC)): BUILD FAILED in 35s
UATHelper: Packaging (Android (ASTC)): ERROR: cmd.exe failed with args /c “C:\Users\Mic\Documents\Unreal Projects\FirstVRtest\Intermediate\Android\arm64\gradle\rungradle.bat” :app:assembleDebug

Adding a picture of some specifications also:

The message “java.lang.OutOfMemoryError” seems to suggest that there’s something up with Java. The project however is really small, just a couple of meshes and some baked lighting so I have a hard time understanding how memory could be an issue? Could this be what f’s up the process? Or is it something with how the SDK/NDK/JDK is setup?

Any input would be greatly appreciated!

SOLVED by reinstalling UE5, JAVA jre + jdk, and starting a new project and setting up the android stuff from scratch. For future reference. Basically if you’re experiencing this, just burn the house down and start from the beginning!