[Android] Gradle runner error for task :app:multiDexListRelease / Java heap space

Bitrise Build Issue Report template

Description of the issue

We haven’t been able to successfully complete a build on Android in many weeks due to this persistent issue. The Gradle runner is failing with the following errors:

> Task :app:multiDexListRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:multiDexListRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Java heap space

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:multiDexListRelease'.
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Caused by: java.lang.OutOfMemoryError: Java heap space

We’ve already tried to increase the Heap Size but still facing the issue.


Where did the issue happen?

Issue happens during Android build, specifically when running gradle task.

Which build Step causes the issue and which version of the step?

id: gradle-runner
version: 1.9.5
collection: https://github.com/bitrise-io/bitrise-steplib.git
toolkit: go


  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? : Every time
  • Does upgrading the build Step to the latest version help? : No (running “Always latest”)
  • When did the issue start? : Sept 3, 2020

Build log

Build log: https://app.bitrise.io/build/f255fbf087e9adcf#?tab=log

Hi @mikebrenner!

Can you try to increase the heap size by adding two variables as described here: https://devcenter.bitrise.io/tips-and-tricks/android-tips-and-tricks/#heap-size?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.