How to stop Gradle task execution in Android Studio?

Is there any legitimate way of Gradle task(s) execution stopping in Android Studio?


you can call ./gradlew --stop in a Terminal and it will kill all gradle processes


No, Gradle (as of this writing, v1.10) has a limitation that you can't cancel tasks through its tooling API, which is what Android Studio uses to communicate with its daemon. You can track the progress of this at https://code.google.com/p/android/issues/detail?id=59464 . It's also preventing progress on something else we'd like to be able to do, https://code.google.com/p/android/issues/detail?id=59965

In the meantime about all you can do is to go through your OS and kill the Gradle processes manually, which is a little painful and messy. It's possible that it could leave your build in some intermediate bad state which would mess up future incremental compiles, but I don't know for sure.


With Android Studio 1.3.2 a kill button appears when the gradle is building on the very bottom of the IDE screen.

build kill button

It doesn't seem to do anything, but at least there's something to push. Wheee! :D