Is there any legitimate way of Gradle task(s) execution stopping in Android Studio?
Run a Gradle task via Run ConfigurationsRight-click the task for which you want to create the Run configuration. From the context menu select Modify Run Configuration. In Create Run Configuration: 'task name', you can use the default settings or configure the additional options and click OK.
You can execute multiple tasks from a single build file. Gradle can handle the build file using gradle command. This command will compile each task in such an order that they are listed and execute each task along with the dependencies using different options.
In Gradle terms this means that you can define tasks and dependencies between tasks. Gradle guarantees that these tasks are executed in the order of their dependencies, and that each task is executed only once. These tasks form a Directed Acyclic Graph.
AnswerOpen the build. gradle file on android/app folder and set the compileSdkVersion & targetSdkVersion to 31 and set the minSdkVersion to 21 so that it would be compatible to older versions of android. Do a flutter clean just to be safe before rebuilding the app.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With