3
votes

I'm newbie with android studio. I'm trying to build project in android studio (make project) and it show me this:

Failed to complete Gradle execution.

Cause: 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: ----------------------- 12:21:07.481 [main] DEBUG o.g.l.daemon.bootstrap.DaemonMain - Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -XX:MaxPermSize=512, -Xmx512m, -Dfile.encoding=windows-1258, -Duser.country=US, -Duser.language=en, -Duser.variant]

FAILURE: Build failed with an exception.

  • What went wrong: Could not create service of type DaemonContext using DaemonServices.createDaemonContext().

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Can anyone help me please!

6

6 Answers

4
votes

Solutions

1) find the location of of your .gradle folder, in Android Studio goto File->Settings and type "gradle" in the search box. You will be able to pick up the correct path there

2)Remove the .gradle directory (mine's location was C:\Users\UserName.gradle), and restart android studio. It will automatically create a new one.

1
votes

go to androidStudio -> open gradle.properties ->

put code in the file

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

Change the following line in gradle.properties

go to: - android studio >> Gradle Scripts >> gradle.properties >> add below line

org.gradle.jvmargs=-Xmx1024m
1
votes

add the following lines to gradle.properties

org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m

but please don't add # (Mistake that I made)

0
votes

Try 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
0
votes

In gradle properties I added this one as suggested above and it worked for me

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