Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Issue

Tags:

android

This error arise 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/2.2.1/userguide/gradle_daemon.html Please read the following process output to find out more: ----------------------- Error occurred during initialization of VM Too small initial heap

Please suggest the solution i have tried many solutions but still not working , i hava 2GB ram. The program for hello world was working fine but when i have start new project this error comes. thanks in advance :)

like image 356
Syed Hamza Hassan Avatar asked Feb 26 '15 12:02

Syed Hamza Hassan


4 Answers

My same issue solve in Android studio by

File -> Settings -> Compiler (Gradle-based Android Projects)

Type in the Teaxt Area of "VM options" to -Xmx512m -XX:MaxPermSize=512m (copy paste may not work just type it)

Note: May be for Android Studio 1.3 or higher "VM Option" wont be visible under the path mentioned above so add the following line in gradle.properties:

org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m

like image 192
Vishal Avatar answered Sep 24 '22 01:09

Vishal


I also got this:

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/2.2.1/userguide/gradle_daemon.html
Please read the following 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.

Simply pressed an icon in right-up bar (near SDK Manager) "Sync Project with Gradle Files", that resolved the problem. Also may press Build > Clean project.

EDIT

Also an advice below may help. Or simply add the following line in gradle.properties:

org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
like image 41
CoolMind Avatar answered Sep 20 '22 01:09

CoolMind


I solved this problem configuring the environment variables JAVA_HOME C:\Program Files\Java\jdk1.8.0_45 JDK_HOME C:\Program Files\Java\jdk1.8.0_45 PATH C:\Program Files\Java\jdk1.8.0_45\bin restart your computer and go to Android Studio, that is all.

like image 23
Diego Felipe Avatar answered Sep 24 '22 01:09

Diego Felipe


  1. Locate C:\Users\Administrator.gradle
  2. Build file named gradle.properties; add content:org.gradle.jvmargs=-Xmx512m
  3. Remake your Android Studio module

I have tried the other three answers, but only this solution works for me.

like image 25
Wesley Avatar answered Sep 24 '22 01:09

Wesley