Android Debug Build Failing

Hey guys,

I am getting the following out of memory error when running an android scriptable build with configurations set to debug.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:launcher:packageDebug’.

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

This error does not occur for “Release” configuration builds.

I have checked and am using the correct password for the keystore so it shouldn’t be that.

Any help would be much appreciated.

Thanks in advance.

Could debug/develop builds just use more memory than release.
I have this also on android builds, on M1/8GB mac. (First time I think I should have waited for the 16GB model. Though my Unity editor crashes with 49GB memory usage once in a while so the apple silicon editor has it’s problems…) It fails instantly when “memory pressure” goes yellow (memory is full?).

Workaround for me is to close all other big memory using programs like vscode, firefox etc. But I think it’s a bug/issue anyway, you should be able to build with a lower spec machine, just take longer. And I have a relatively small project, if your project is big your memory use is probably also bigger.