Home > Software engineering >  How to fix his Error Exception: Gradle task assembleDebug failed with exit code 1
How to fix his Error Exception: Gradle task assembleDebug failed with exit code 1

Time:10-16


Launching lib\main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... 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 https://docs.gradle.org/6.7/userguide/gradle_daemon.html Process command line: C:\Program Files\Android\Android Studio\jre\bin\java.exe --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xmx1536M -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\ilapa.gradle\wrapper\dists\gradle-6.7-all\cuy9mc7upwgwgeb72wkcrupxe\gradle-6.7\lib\gradle-launcher-6.7.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.7 Please read the following process output to find out more:

There is insufficient memory for the Java Runtime Environment to continue. Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap An error report file with more information is saved as: C:\Users\ilapa.gradle\daemon\6.7\hs_err_pid36120.log 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.


CodePudding user response:

You're allocating 1.04 MB to the Daemon (which is very low). Increase the allocated memory to at least 1 GB by adding this to your gradle.properties file:

org.gradle.jvmargs= -Xmx1G
  • Related