'Flutter: Unable to start the daemon process(java.lang.ClassNotFoundException: org.gradle.launcher.daemon.bootstrap.GradleDaemon)
Due to character limit, I posted the same problem in Github, Contains detailed operating information。https://github.com/flutter/flutter/issues/101572
Flutter suddenly runs errors, this is still normal a few days ago, I didn't make any changes during the period.
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:\sdk\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=GBK -Duser.country=CN -Duser.language=zh -Duser.variant -cp C:\Users\Venusؼ\.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:
-----------------------
����: �Ҳ��������������� org.gradle.launcher.daemon.bootstrap.GradleDaemon
ԭ��: java.lang.ClassNotFoundException: org.gradle.launcher.daemon.bootstrap.GradleDaemon
* 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 https://help.gradle.org
Running Gradle task 'assembleRelease'... 3.4s
Gradle task assembleRelease failed with exit code 1
This is my device information:
- Windows: 11 21H2 22000.556 (notebook)
- Flutter: 2.10.3
flutter doctor -v
[√] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.22000.556], locale zh-CN)
• Flutter version 2.10.3 at C:\sdk\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7e9793dee1 (5 weeks ago), 2022-03-02 11:23:12 -0600
• Engine revision bd539267b4
• Dart version 2.16.1
• DevTools version 2.9.2
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\sdk\android\sdk
• Platform android-31-2, build-tools 31.0.0
• Java binary at: C:\sdk\android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
• Android Studio at C:\sdk\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 11.0.11+9-b60-7590822)
[√] Connected device (4 available)
• M2007J1SC (mobile) • 5147b914 • android-arm64 • Android 12 (API 31)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.556]
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.75
• Edge (web) • edge • web-javascript • Microsoft Edge 100.0.1185.29
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
I have tried some methods, for example:
- 'if u are using a laptop and using a mobile hotspot from your laptop turn it off and run the program i hope this will solve your problem it worked for me.'
- delete 'org.gradle.jvmargs=-Xmx1536M' or changed to 'org.gradle.jvmargs=-Xmx1024m',and restart the project。 unfortunately, these are useless to me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|