Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Error:Failed to complete Gradle execution. Cause: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)"

Tags:

android

gradle

my android studios started freezing up on me so I killed the task using task manager and when I reopened android studio I got this error:

Error:Failed to complete Gradle execution. Cause: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

I tried cleaning and rebuilding the gradle and closing out and reopening android but it doesn't go away. The main answers on stack overflow seem to have outdated answers to click on things that are not there anymore such as Settings-->Gradle-->GradleVM options.

like image 386
Ryder Thacker Avatar asked Jan 16 '17 20:01

Ryder Thacker


People also ask

What is Gradle daemon?

The Gradle daemon is a background process that stays alive between builds, caching both data and code. Most recent versions of Gradle automatically start a Gradle daemon whenever you run from the command prompt.

How do I find my Gradle version?

In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here.

What is org Gradle Jvmargs?

org.gradle.jvmargs - specifies jvmargs used for daemon process. You want to set high enough memory limit to fix dex in Gradle process, so minimum configuration here is -Xmx2g , while 3-4 gigabytes won't hurt either.


2 Answers

As outlined here: https://developer.android.com/studio/intro/studio-config.html

To change the VM heap size do the following: 1. Help > Edit Custom VM Options 2. Add the line

-XmxheapSize

, where heapSize is the size you want. ie.

-Xmx2g

for 2 gigs

like image 182
donny.rewq Avatar answered Sep 28 '22 07:09

donny.rewq


i solved it from information issue tracker it happen in android 3.0 canary 4

  1. go to gradle.properties
  2. add this code android.enableAapt2=false
like image 20
reza rahmad Avatar answered Sep 28 '22 09:09

reza rahmad