I just updated Android Studio to version 4.2. I was surprised to not see the Gradle tasks in my project.
In the previous version, 4.1.3, I could see the tasks as shown here:
But now I only see the dependencies in version 4.2:
I tried to clear Android Studio's cache and sync my project again, but there was no change.
Is this a feature change?
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.
Within IntelliJ IDEA, find the check task in the Gradle tool window under verification. Double click it to run. Check is also run when you run the build task, thanks to a task dependency setup by the base plugin. Gradle runs the assemble task then check.
To see which tasks are available for our build we can run Gradle with the command-line option -t or --tasks. Gradle outputs the available tasks from our build script. By default only the tasks which are dependencies on other tasks are shown. To see all tasks we must add the command-line option --all.
OK, I found why I got this behaviour in android studio 4.2.
It is intended behaviour. I found the answer in this post: https://issuetracker.google.com/issues/185420705.
Gradle task list is large and slow to populate in Android projects. This feature by default is disabled for performance reasons. You can re-enable it in: Settings | Experimental | Do not build Gradle task list during Gradle sync.
Reload the Gradle project by clicking the "Sync Project with gradle Files" icon and the tasks will appear.
It could be cool that this experimental change is put in the release note of android studio 4.2
.
Go to File -> Settings -> Experimental
and uncheck Do not build Gradle task list during Gradle sync
, then sync the project File -> Sync Project with Gradle Files
. If the problem is still there, just reboot Android Studio.
1.
2.
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