Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio Gradle sync and build error

I am new to android studio and gradle and i got AS 0.5. I downloaded the 0.8.1 update package and updated by deleting the installed files and copying the update files to the program files folder. It runs correctly but when i try to sync gradle, i get this error. It's really frustrating because i have an extremely slow internet connection and i have tried deleting the .gradle file and trying again wit no luck. Any help will be appreciated. My ADT is currently messed up because of the r23 bug. I thought AS will offer a way out and now I'm stuck again.

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:

18:44:13.593 [main] DEBUG o.g.l.daemon.bootstrap.DaemonMain - Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252]

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.
like image 697
Michael Obi Avatar asked Jul 02 '14 18:07

Michael Obi


2 Answers

Run Android Studio as administrator. It fixed the problem for me.

like image 118
Nyein Chan Wynn Avatar answered Sep 23 '22 10:09

Nyein Chan Wynn


For anyone encountering this error on Linux (Ubuntu 14.04 in my case), I found the problem was that the /tmp directory was mounted with a "noexec" flag, preventing AS from starting Gradle.

After removing the "noexec" flag in /etc/fstab and a restart, AS was able to run Gradle properly:

jayne@serenity:~$ grep tmpfs /etc/fstab
tmpfs /tmp tmpfs mode=1777,nosuid 0 0

Many thanks to: www.fernandezsansalvador.es (and Google Translate)

like image 23
wtfc63 Avatar answered Sep 26 '22 10:09

wtfc63