Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Keep saying Failed to complete Gradle execution

Tags:

android

gradle

Everything fine with the command line

gradle build

But Android Studio keep saying that

Failed to complete Gradle execution
Cause:
A fatal exeption has occurred. Program will exit

If I clear all the cache, and restart everything will be fine, but this dialog will easily comeback again (after a build fail). I guess that the increment build chain is not good, but the message is not helpful at all.

Are there anythings I can do to get a more details message about what going on, why AndroidStudio Gradle failed? where can I put thing like --stacktrace in the Preferences of Android Studio?

like image 258
Hiep Avatar asked May 11 '14 22:05

Hiep


People also ask

How do I fix Gradle sync failed?

Then open Android Studio and go to File > Settings > Build, Execution and Deployment > Gradle > Use Gradle from > Set the path of the downloaded Gradle. Step 4. Now try syncing the Gradle again and check if the error still persists.

What is Android Studio Gradle?

Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.


2 Answers

If you got a problem like this in Android studio, then don't worry about that, you are missing some thing which are here.

Go to File-->Setting-->Gradle-->Gradle Vm Option, Now put this value -Xmx256m in the box, and hit the Apply button.

Here you have solved the problem.

like image 127
Pir Fahim Shah Avatar answered Sep 22 '22 10:09

Pir Fahim Shah


At my case, I forgot to include some jars at Libs folder at the Gradle file, actually I forgot to add ".jar" to the end of jar file name.

like image 44
Ayman Mahgoub Avatar answered Sep 21 '22 10:09

Ayman Mahgoub