# Java.lang.outofmemoryerror (no error message)/Unable to find EOCD signature

**URL:** <https://forums.unrealengine.com/t/java-lang-outofmemoryerror-no-error-message-unable-to-find-eocd-signature/504079>\
**Category:** XR Development\
**Tags:** unreal-engine, oculus-vr, UE5-0, build-failed, UE4-27, question\
**Created:** [March 4, 2022, 4:44pm UTC](https://forums.unrealengine.com/t/java-lang-outofmemoryerror-no-error-message-unable-to-find-eocd-signature/504079 "2022-03-04T16:44:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Milos\_VR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ricardo\_Milos\_VR](https://forums.unrealengine.com/u/Ricardo_Milos_VR)\
**Post date:** [March 4, 2022, 4:44pm UTC](https://forums.unrealengine.com/t/java-lang-outofmemoryerror-no-error-message-unable-to-find-eocd-signature/504079/1 "2022-03-04T16:44:06Z")

</div>

Hi, building of my app for Quest 2 stops with “java.lang.outofmemoryerror (no error message)”. I’ve tried to delete Intermediate, change -Xmx in gradle.properties in project, didn’t help. Any ideas?

After several reboots I’ve caught “Unable to find EOCD signature”. I’m starting to hate android development. How can I fix that?

---

<div class="post-metadata">

**Author:** ![Suriba](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Suriba](https://forums.unrealengine.com/u/Suriba)\
**Post date:** [April 6, 2022, 8:58am UTC](https://forums.unrealengine.com/t/java-lang-outofmemoryerror-no-error-message-unable-to-find-eocd-signature/504079/2 "2022-04-06T08:58:03Z")

</div>

For me,when I try to package the game with an obb file larger than 2GB inside the apk file cause the error“java.lang.outofmemoryerror (no error message)” ,just let the obb file outside.even if you devide data to chunks to paks to 2 obb files,The package option "Package obb inside apk"will just handle the main obb but not the patch one.  
“Unable to find EOCD signature” can be fixed easily by AndroidStudio-clean project or just delete Intermediate-Android and build the project.(you may not able us AS to clean the project when the editor is still running.  
gradle.properties is program generated and copied to gradle project when use ue package,you cant just simply edit the gradle.properties and try to use ue package.

---

<div class="post-metadata">

**Author:** ![Suriba](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Suriba](https://forums.unrealengine.com/u/Suriba)\
**Post date:** [June 22, 2022, 3:51am UTC](https://forums.unrealengine.com/t/java-lang-outofmemoryerror-no-error-message-unable-to-find-eocd-signature/504079/3 "2022-06-22T03:51:50Z")

</div>

Sometimes last builds obb file may be left in stagebuild folder will trigger this ierror.  
This error caused by java cant deal with files larger than about 2GB with native method caused by javas int range.

---

<div class="post-metadata">

**Author:** ![adeelyaqoobj](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adeelyaqoobj/32/680629_2.png) [@adeelyaqoobj](https://forums.unrealengine.com/u/adeelyaqoobj)\
**Post date:** [October 12, 2023, 2:26am UTC](https://forums.unrealengine.com/t/java-lang-outofmemoryerror-no-error-message-unable-to-find-eocd-signature/504079/4 "2023-10-12T02:26:35Z")

</div>

@Suriba How to solve this then? I do get the JAVA Heap Space Error when I check the option “Generate AAB Bundle”.

---

<div class="post-metadata">

**Author:** ![stealthhacked](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stealthhacked](https://forums.unrealengine.com/u/stealthhacked)\
**Post date:** [March 10, 2025, 4:05pm UTC](https://forums.unrealengine.com/t/java-lang-outofmemoryerror-no-error-message-unable-to-find-eocd-signature/504079/5 "2025-03-10T16:05:59Z")

</div>

Is there a solution to date to allow gradle to compress a 4gb apk, as you stated i also tried splitting main.obb and patch.obb but only main.obb is included into the apk and larger single obb over 2gb just gives compression error.
