Repository: flutter
Issue: "Starting Gradle daemon" loop creating endless processes
Labels: platform-android,tool,t: gradle,P3,team-android,triaged-android

Every time I run **flutter run**, and it starts doing its build, it gets to **Gradle Daemon Start**, but loops and keeps repeating this step. As a result, the build never ends and continues to build Gradle daemon processes until the system runs out of memory and freezes. I provide all the info below. thank you

```bash
#log

Dart Code extension: 3.21.1
Flutter extension: 3.21.0 (activated)

App: Visual Studio Code
Version: 1.55.0
Platform: win

Workspace type: Flutter
Analyzer type: DAS
Multi-root?: false

Dart SDK:
    Loc: C:\tools\flutter\bin\cache\dart-sdk
    Ver: 2.12.2
Flutter SDK:
    Loc: C:\tools\flutter
    Ver: 2.0.4

HTTP_PROXY: undefined
NO_PROXY: undefined
----
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [ +341 ms] Building APK
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [{"event":"app.progress","params":{"appId":"12b50ac9-36cb-4de6-8f23-ccdfba87702f","id":"0","progressId":null,"message":"Running Gradle task 'assembleDebug'...","finished":false}}]
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [ +120 ms] Using gradle from C:\Users\Charlot\Dev\projects\mga.ent\apps\services\android\gradlew.bat.
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [   +6 ms] C:\Users\Charlot\Dev\projects\mga.ent\apps\services\android\gradlew.bat mode: 33279 rwxrwxrwx.
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [  +40 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [ +487 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [        ] openjdk version "1.8.0_242-release"
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <==            OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <==            OpenJDK 64-Bit Server VM (build 25.242-b01, mixed mode)
[10:54:40 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [   +5 ms] executing: [C:\Users\Charlot\Dev\projects\mga.ent\apps\services\android/] C:\Users\Charlot\Dev\projects\mga.ent\apps\services\android\gradlew.bat -Pverbose=true -Ptarget-platform=android-x86 -Ptarget=C:\Users\Charlot\Dev\projects\mga.ent\apps\services\lib\main.dart -Ptrack-widget-creation=true -Pfilesystem-scheme=org-dartlang-root -Pdart-defines=flutter.inspector.structuredErrors%3Dtrue assembleDebug
[10:54:43 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [+2643 ms] Welcome to Gradle 6.7!
[10:54:43 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [        ] Here are the highlights of this release:
[10:54:43 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [   +1 ms]  - File system watching is ready for production use
[10:54:43 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [   +1 ms]  - Declare the version of Java your build requires
[10:54:43 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [        ]  - Java 15 support
[10:54:43 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [        ] For more details see https://docs.gradle.org/6.7/release-notes.html
[10:54:46 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [+3185 ms] Starting a Gradle Daemon, 20 busy Daemons could not be reused, use --status for details
[10:54:56 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [+10087 ms] Starting a Gradle Daemon, 22 busy Daemons could not be reused, use --status for details
[10:55:04 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [+8037 ms] Starting a Gradle Daemon, 24 busy Daemons could not be reused, use --status for details
[10:55:12 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [+7761 ms] Starting a Gradle Daemon, 26 busy Daemons could not be reused, use --status for details
[10:55:20 AM] [FlutterRun] [Info] [Flutter (Galaxy Note Ultra API 30)] <== [+8194 ms] Starting a Gradle Daemon, 28 busy Daemons could not be reused, use --status for details
```

```bash
#gradle --status

No Gradle daemons are running.
   PID STATUS   INFO
  7660 STOPPED  (by user or operating system)
 11560 STOPPED  (by user or operating system)
  1832 STOPPED  (by user or operating system)
 11524 STOPPED  (by user or operating system)
 12332 STOPPED  (by user or operating system)
  5428 STOPPED  (by user or operating system)
   596 STOPPED  (by user or operating system)
 11248 STOPPED  (by user or operating system)
 11288 STOPPED  (by user or operating system)
 10112 STOPPED  (by user or operating system)
  9004 STOPPED  (by user or operating system)
  7248 STOPPED  (by user or operating system)
  3080 STOPPED  (by user or operating system)
  7944 STOPPED  (by user or operating system)
  4568 STOPPED  (by user or operating system)
 11732 STOPPED  (by user or operating system)
 10828 STOPPED  (by user or operating system)
  8496 STOPPED  (by user or operating system)
  2764 STOPPED  (by user or operating system)
  9260 STOPPED  (by user or operating system)
  5596 STOPPED  (by user or operating system)
  5484 STOPPED  (by user or operating system)
  1592 STOPPED  (by user or operating system)
 11900 STOPPED  (by user or operating system)
  7492 STOPPED  (by user or operating system)
  8380 STOPPED  (by user or operating system)
  7956 STOPPED  (by user or operating system)
  9244 STOPPED  (by user or operating system)

Only Daemons for the current Gradle version are displayed. See https://docs.gradle.org/6.7/userguide/gradle_daemon.html#sec:status
```

```bash
#flutter doctor result

[√] Flutter (Channel stable, 2.0.4, on Microsoft Windows [Version 10.0.19042.906], locale en-US)
    • Flutter version 2.0.4 at C:\tools\flutter
    • Framework revision b1395592de (10 days ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Charlot\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.55.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.21.0

[√] Connected device (1 available)
    • Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.68

! Doctor found issues in 1 category.
```

![task](https://user-images.githubusercontent.com/47641375/114302823-583e3b00-9aba-11eb-90c1-ea22cbecc444.PNG)