Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Flutter Android build says Gradle cannot start its daemon

ErrorUnable to start the daemon process.

Short answer

Gradle starts a separate daemon JVM and the build fails if that JVM cannot launch. Read the process output printed after the message. It usually shows a JVM option the Java in use rejects in org.gradle.jvmargs, or a Java version outside what Gradle supports. Fix the option or point Gradle at a supported JDK.

  • Applies to Gradle 9.x, Flutter 3.x, JDK 17
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Scroll to the lines after 'process output'. They are the JVM's own error and name the real cause. Then list the Java your shell uses and the daemon settings the project sets.

    java -version
    cd android
    grep -n "jvmargs\|java.home" gradle.properties ~/.gradle/gradle.properties
  2. 2Match what you see, then jump to its fix

    1. 1The process output names a JVM option as unrecognized or invalidA JVM option in org.gradle.jvmargs that this Java does not acceptFix
    2. 2java -version prints a very old or very new releaseThe JDK is outside the range Gradle can run onFix

What does the error look like?

  • 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 read the following process output to find out more:

Cause 1 of 2

A JVM option in org.gradle.jvmargs that this Java does not accept

1Check

org.gradle.jvmargs sets the JVM arguments of the daemon. Gradle reads it from the project gradle.properties and from the one in the Gradle user home, and the user-home file wins over the project file. A line copied from an old tutorial may carry a flag the current JVM removed.

grep -n "jvmargs" android/gradle.properties ~/.gradle/gradle.properties

2Fix

Remove the rejected flag, or replace the whole line with plain heap settings. Keep the value on one line.

# android/gradle.properties
org.gradle.jvmargs=-Xmx2g

3Verify

Stop old daemons so the next build starts a new one with the new arguments, then build.

cd android && ./gradlew --stop
cd .. && flutter build apk --debug

Confirmed by docs.gradle.org

Did this fix it?

Cause 2 of 2

The JDK is outside the range Gradle can run on

1Check

A current Gradle needs a JVM between 17 and 27 to execute; which exact upper limit applies depends on the Gradle release in gradle/wrapper/gradle-wrapper.properties. JAVA_HOME, or the java on the path, is the default JVM for the daemon.

java -version
echo "$JAVA_HOME"
grep distributionUrl android/gradle/wrapper/gradle-wrapper.properties

2Fix

Install a JDK that your Gradle release supports and point Gradle at it, either with JAVA_HOME or with org.gradle.java.home in gradle.properties.

# android/gradle.properties
org.gradle.java.home=/path/to/jdk-17

3Verify

Stop the old daemons and run the build again.

cd android && ./gradlew --stop
./gradlew --version

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Keep org.gradle.jvmargs short: only -Xmx plus flags you know the JDK supports.
  • Change the JDK and the Gradle version together, and check the compatibility table first.
  • After editing gradle.properties, run ./gradlew --stop so no daemon with the old settings is reused.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Google Play says the app does not support 16 KB memory pages

check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a

Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.