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

后端 未结 19 2010
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 18:22

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 a

相关标签:
19条回答
  • 2020-11-27 18:43

    On newer version of AS 2.0 File->Setting->Build, Deployment &Execution-Compilers->Android Compilers->Gradle->Gradle Vm Option

    put this as an option -Xmx256m

    0 讨论(0)
  • 2020-11-27 18:43

    This can be because you have specified any command line option in android studio settings. You can check this by going to

    File > Settings > Build, Execution, Deployment > Compiler

    and see "Command-line-options" and check if anything is give. (In your case -x). If so remove it and click Apply and Ok. It worked for me...

    0 讨论(0)
  • 2020-11-27 18:44

    I had the same problem, and the problem was gone after upgrading my Android Studio from 1.2.1 to 1.5.1. There was no error even after adding --stacktrace --info to VM options. Gradle tasks would finish successfully, but the application just wouldn't launch (and studio would gray out the run button forever, probably waiting for a response from emulator). I had tried everything else mentioned here.

    0 讨论(0)
  • 2020-11-27 18:45

    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.

    0 讨论(0)
  • 2020-11-27 18:47

    Honestly speaking, to me none of the above solutions worked and i almost fought over this for 3 days. Finally ultimate solution was to backup my project, uninstall studio and its trace files completely, clear files from temp, %temp% and prefetch folders and then reinstall all over again and finally it worked.

    Pls discard my above answer which i taught was one of the solutions. I faced this problem repeatedly because 1 of my teammate forgot to include git.ignore file while pushing code to bitbucket and everytime i used to pull that code and then gradle used to pop the above problem. And after figuring out that, i have added proper git.ignore file and now there's no any problem on any1's pc :)

    0 讨论(0)
  • 2020-11-27 18:48

    I cleaned up the project, tried again and the problem was gone.

    0 讨论(0)
提交回复
热议问题