3

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!

ImP
  • 65
  • 1
  • 1
  • 6

6 Answers6

4

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.

sasikumar
  • 12,540
  • 3
  • 28
  • 48
  • I delete .gradle directory and restart Android Studio, but it show "gradle project sync failed. basic functionality (e.g. editing, debugging) will not work properly" and I get the same error like above. – ImP Jun 18 '15 at 05:50
  • refer this http://stackoverflow.com/questions/21066598/android-studio-0-4-2-gradle-project-sync-failed-error – sasikumar Jun 18 '15 at 05:57
1

go to androidStudio -> open gradle.properties ->

put code in the file

org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
Pratik
  • 97
  • 1
  • 11
1

Change the following line in gradle.properties

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

org.gradle.jvmargs=-Xmx1024m
Dipiks
  • 3,818
  • 2
  • 23
  • 39
Rohit
  • 11
  • 1
  • 6
1

add the following lines to gradle.properties

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

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

Rahul Sharma
  • 2,867
  • 2
  • 27
  • 40
Molly
  • 1,887
  • 3
  • 17
  • 34
0

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
Mahendran Candy
  • 1,114
  • 17
  • 17
0

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

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

Deepak S
  • 183
  • 1
  • 10