Search Issue Tracker

Fixed in 2018.3.X

Fixed in 2017.4.X, 2018.2.X



Found in


Issue ID




[Android] Gradle build fails when building project with asset bundle



Reproduction steps:
1. Open the attached project
2. The project has 1 asset bundle. The bug isn't reproducible using other asset bundles or even the same bundle but using different compression
3. Try to build for Android using Gradle
4. Fails with following output:

CommandInvokationFailure: Gradle build failed.
C:/Program Files/Java/jdk1.8.0_111\bin\java.exe -Xmx1024M -classpath "C:\Program Files\Unity 2017.3.0b1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "--no-daemon" "assembleDebug"


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':packageDebug'.
> Java heap space

and following error window:

Regression introduced in 2017.3.0b1

Reproducible in:
2019.1.0a6, 2018.3.0b1, 2018.3.0a6

Windows 10 and Mac 10.13

Comments (45)

  1. dariony

    Mar 15, 2018 18:27

    Anyone know if this is still an issue in 2018.1?

  2. bugaboostudio

    Mar 09, 2018 02:35

    Same problem in 2017.3.0f3 and 2017.3.01f1 using Gradle or Internal. Only permits a build with 1,9GB size for android.

  3. dmart331

    Feb 28, 2018 18:07

    Having this issue in 2017.3.1f1. Project only consists of GoogleVR and on 360 video. Can build the project until I add clip to video player.

  4. Joppers

    Feb 16, 2018 08:15

    We’re seeing this error since updating to 2017.3.1f1. We have no asset bundles but a large number of files in Resources folders.

  5. stefano_s

    Feb 13, 2018 10:16

    I can build the project only using the split binary flag

  6. F360

    Feb 10, 2018 11:39

    the same here in Unity 2017.3.1f1 using a 360 video while building Gradle project under task validatingSigningRelease.

    Build failure Java heap space.

  7. caletbak2

    Feb 01, 2018 08:51

    This is also happening to me, but we do not have assetbundles. It is just a problem when building with Gradle in big projects. I have opened a thread in the forum without any answer:

    Unity is basically forcing the amount of heap memory when triggers gradle process overriding the user

  8. ArtC0de

    Jan 31, 2018 08:06

    Same here, using 2017.3.0f3 and Windows 10

  9. andrew-rafe

    Jan 29, 2018 02:56

    The same error is occurring in cloud build as well as on my local computer

  10. CrisCL

    Jan 25, 2018 02:03

    This happened to me, when building for Android - Cardboard the "Interactive 360 Sample Project" unity asset version 1.0, just like it is.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.