Question by
DaboDerMonser · Sep 11, 2020 at 12:16 AM ·
androidbuild-errorfailure
Android Build failed with an exception - Help
Hello Unity Forum,
after trying to build my android game the error below occurred, how can I fix it? (I'm using Unity 2018.2.12f1 (64-bit))
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_261\bin\java.exe -classpath "C:\Program Files\Unity 2018.2.12\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':packageRelease'.
> org.gradle.tooling.BuildException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 7m 25s
]
stdout[
Starting a Gradle Daemon (subsequent builds will be faster)
:preBuild UP-TO-DATE
:preReleaseBuild
:compileReleaseAidl
:compileReleaseRenderscript
:checkReleaseManifest
:generateReleaseBuildConfig
:prepareLintJar
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:createReleaseCompatibleScreenManifests
:processReleaseManifest
:splitsDiscoveryTaskRelease
:processReleaseResources
:generateReleaseSources
:javaPreCompileRelease
:compileReleaseJavaWithJavac
:compileReleaseNdk NO-SOURCE
:compileReleaseSources
:lintVitalRelease
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:mergeReleaseAssets
:transformClassesWithPreDexForRelease
:transformDexWithDexForRelease
:mergeReleaseJniLibFolders
:transformNativeLibsWithMergeJniLibsForRelease
:processReleaseJavaRes NO-SOURCE
:transformResourcesWithMergeJavaResForRelease
:validateSigningRelease
:packageRelease
Expiring Daemon because JVM Tenured space is exhausted
Daemon will be stopped at the end of the build after running out of JVM memory
Expiring Daemon because JVM Tenured space is exhausted
Expiring Daemon because JVM Tenured space is exhausted
:packageRelease FAILED
Expiring Daemon because JVM Tenured space is exhausted
25 actionable tasks: 25 executed
Expiring Daemon because JVM Tenured space is exhausted
Expiring Daemon because JVM Tenured space is exhausted
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613011618im_/https://answers.unity.com/themes/thub/images/avi.jpg)