2

I Am Getting A Error java.lang.OutOfMemoryError (no error message) While Generating A Signed Android App Bundle (AAB) Of My project. Here Is The Full Error Message-

***Execution failed for task ':app:signReleaseBundle'.

A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable java.lang.OutOfMemoryError (no error message)

  • Try: 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.***

I Tried Running It With --stacktrace And it Is Showing Different Error- Out of memory: Java heap space. Configure Gradle memory settings using '-Xmx' JVM option (e.g. '-Xmx2048m'.) Please fix the project's Gradle settings.

I Am Not Getting Any Error Message And Searched A Lot To Solve This Problem. Any Help Will Be Appreciated.

Arnav
  • 439
  • 2
  • 4
  • 11
  • 1
    Did you try what your IDE (I assume) suggested you try? "Run with --stacktrace option to get the stack trace". But apart from that, no-one here can hep you debug code that you have not shown us. – user16632363 Nov 24 '21 at 03:24
  • Here's The New Error- Out of memory: Java heap space. Configure Gradle memory settings using '-Xmx' JVM option (e.g. '-Xmx2048m'.) Please fix the project's Gradle settings. – Arnav Nov 24 '21 at 03:25
  • Oh, I guess you're not running your code, you're running signing code. Sorry about that. – user16632363 Nov 24 '21 at 03:28
  • Yes. When I Run The App On My Device To Test It It Runs Perfectly But When I Am Trying To Generate Signed AAB It Is Showing The Above Mentioned Error – Arnav Nov 24 '21 at 03:31
  • 1
    @Arnav - Question: why are you capitalizing every word? In English the convention is to capitalize the first word of a sentence, proper names and ... I. – Stephen C Nov 24 '21 at 04:54
  • The Gradle process has filled up its heap. The solution is to do what the error message says. *"Configure Gradle memory settings using '-Xmx' JVM option (e.g. '-Xmx2048m'.) Please fix the project's Gradle settings."*. You can read about the `-Xmx` option in the Java manual. – Stephen C Nov 24 '21 at 04:58
  • I know, I have a habit of typing Like This. B.t.w if you know the how to solve the error please tell. – Arnav Nov 24 '21 at 04:59
  • It is a bad habit. People find it distracting when you write like that. Counterproductive. – Stephen C Nov 24 '21 at 05:00
  • It helped me. Thanks a lot. – Arnav Nov 24 '21 at 05:12
  • Does this answer your question? [Android Studio Build gradle OutOfMemoryError](https://stackoverflow.com/questions/39547100/android-studio-build-gradle-outofmemoryerror) – Troy Mar 16 '22 at 08:18

1 Answers1

10

Go to Settings > Appearance behavior > System settings > Memory settings and set everything to its maximum value.

enter image description here

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
akkmastr
  • 186
  • 6