20 August 2014

How to solve error: Error: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 guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html Please read below process output to find out more: ----------------------- Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

Solution for Android Studio 0.8.6 STORY: I recently back to developing some android application. Unfortunately Google as usual do lots of changes and decided to move admob library to Google play services and this forced me to use Android Studio with Gradle. It means ,I needed to migrate my IntelliJ IDEA to Android Studio,but this cause some problems. When you create build.gradle file and then Android Studio detect that and it tries convert project into Gradle project but it welcomed me with error :
Error: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 guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html Please read below process output to find out more: ----------------------- Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit."If you see this error, Try these possible solutions.
SOLUTION: If you see this depressing error:
  • Remember to have enough free memory on your device.( I had problem if i didn't have 1GB of free memory)
  • Run Android Studio as Administrator
If this doesn't help,then you need increase (or set ) maximum Java heap size. In other to do that you need :
  1. (optional) Run Android Studio as Administrator
  2. Go to File and press Settings (or use shortcut: Ctrl+Alt+S)
  3. Go to Compiler
  4. Find VM Options and put -Xmx512m.
  5. Press Apply
  6. Press OK
  7. restart IDE

It should works now.
I hope, it helps .Good luck and have fun with development.