Android export error gradle " FAILURE: Build failed with an exception."

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Miisan

Any methods to get passed this build error?

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the User Manual chapter on the daemon at The Gradle Daemon
    Process command line: C:\Program Files (x86)\Java\jre1.8.0_331\bin\java.exe -Xmx4536m -Dfile.encoding=windows-1252 -Duser.language=en -Duser.variant -cp C:\Users\Mi.gradle\wrapper\dists\gradle-7.2-bin\2dnblmf4td7x66yl1d74lt32g\gradle-7.2\lib\gradle-launcher-7.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.2
    Please read the following process output to find out more:

Invalid maximum heap size: -Xmx4536m
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

  • 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.

  • Get more help at

windows 10 JAVA_HOME

ramazan | 2022-08-25 14:05

did you find the solution to the issue?

Hi! i have this problem too with godot 4.2.1

I found a similar problem in a Unity forum, with same error, and the solution they propose was, “just change Android SDK Platform until one works”, so i changed * Android SDK Platform to 33 without any ext, reboot, and done.

Now i can compile for android with gradle.