Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: failed to complete gradle execution, cause is empty

When I try to run an Android emulator, I get the following error screen. The same occurs when I export the apk. When I go to the directory where the apk will be saved, the apk file is not there.

Thank you,
christophe

enter image description here

like image 301
user3142817 Avatar asked Dec 10 '14 18:12

user3142817


3 Answers

I had the same issue, this problem will be fixed by doing the below step.

Go to

File->Setting->Gradle->Gradle Vm Option

For Android Studio 1.2

File->Setting->Build, Deployment &Execution->Build Tools->Gradle->Gradle Vm Option

, Now put this value -Xmx256m in the box, and hit the Apply button.

like image 113
A J Avatar answered Nov 19 '22 03:11

A J


  1. Click "Gradle Console" for the log from Gradle.
  2. Debug from the error messages
    • Mac: In Android Studio, go to:
      • "Preference"
      • "Build, Execution, Deployment"
      • "Compiler"
      • Add "--stacktrace" to "Command-line Options"

Note the error will usually be listed as the first line (improperly formatted for Android Studio Gradle console such as:

AGPBI: {"kind":"error","text":"Float types not allowed (at \u0027icon_alpha_active\u0027 with value \u00270.75\u0027).","sources":[{"file":"/Users/mingsheng/path/to/my/errenous/integers.xml","position":{"startLine":5,"startColumn":38,"startOffset":272,"endColumn":42,"endOffset":276}}],"original":""}

Where "text" = error message, "sources: file" = errenous filepath/name

In this example, I have entered a Float value in the integers file.

like image 26
Mingsheng Avatar answered Nov 19 '22 04:11

Mingsheng


This dialog box with empty cause also comes when there is some error in your resource(res) directory. Check for any error in layout files etc.

like image 19
sv_jan5 Avatar answered Nov 19 '22 04:11

sv_jan5