Starting a Gradle Daemon, x busy Daemons could not be reused, use --status for details, recursion until RAM floods

Open
#92 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
flutter, java, kotlin, rust

Research direction

Start by reproducing the issue with the shown build.gradle tasks.whenTaskAdded block and flutter build apk, then inspect the output of Gradle's --status command. Trace why each task addition causes another daemon to start; done means the APK build completes without recursively creating daemons or exhausting RAM.

Written by the indexing model from the issue text.

Description

When I added

tasks.whenTaskAdded { task ->
    if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) {
        task.dependsOn 'cargoBuild'
    }
}

to my flutter project's build.gradle and when I do flutter build apk I get things like

Starting a Gradle Daemon, 18 busy Daemons could not be reused, use --status for details
Starting a Gradle Daemon, 19 busy Daemons could not be reused, use --status for details
...

and then it keeps starting a new one until my RAM floods and the computer crashes. If I comment that code, it builds, but of course without gradle.

Is there a way to debug more to see what is hapening? Looking at the system monitor, it's starting lots of java gradle daemons

Dominant language
Kotlin
Stars
1.3k
Forks
95
Avg merge
15m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/rust-android-gradle

All issues in mozilla/rust-android-gradle

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.