Flutter error Unable to start the daemon process

My flutter project is run smoothly in my old laptop. But when I use my new laptop, my flutter project can't run in debug mode.

This error

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/5.6.2/userguide/gradle_daemon.html

Process command line: C:\Program Files (x86)\Java\jre1.8.0_221\bin\java.exe -Xmx1536M -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\ajoris\.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb\gradle-5.6.2\lib\gradle-launcher-5.6.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.6.2

Please read the following process output to find out more:

-----------------------

Error occurred during initialization of VM

Could not reserve enough space for 1572864KB object heap

Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystems Inc."


* 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.

Is there something missing in the settings on my new laptop? I tried to clean project, upgrade flutter but always fail. Sorry for new


What actually worked for me is, In windows 10 just turn off your mobile hotspot and run the app again. I think it's a glitch in windows 10.


The general steps I would use are:

  1. run flutter doctor in terminal
  2. if you are using an emulator make sure it has enough space (often it needs a restart to clear junk files created upon consecutive deploys)
  3. if the gradle files have been modified it is recommended to open them with Android Studio (Android folder of the application). If anything is missing the IDE will prompt you to install the missing dependencies. Hope it helps