Skip to content
Source

Clean / Rebuild Project

In the new canary version of Studio they removed the menu items Build - Clean and Build - Rebuild Project. Yeah, the two most clicked buttons in Studio after Invalidate Caches and Restart were removed, you understood correctly. 💥

And of course we learn about this from posts on r/mAndroidDev, because in the changelog of Studio changes to the Build menu are mentioned, but not specifically this. They say that overall the improvements are more aimed at making all these tasks run only on the selected configuration, not on the whole project.

The idea to come up with something about this is quite commendable, since few developers even think about how much rebuilding all source sets is overkill for the problem they're trying to solve. But they removed it and didn't give any replacement. You can still find it through general search, but it's no longer in the menu.

The Clean item always did gradle clean in the root, if I'm not mistaken, i.e. deleted build results in all submodules. Well yes, it will affect extra modules if they're not used in the current configuration, but usually it's not that long. And Google's actions are now clearly aimed at not showing us that there's some kind of Gradle under the hood at all.

My complaint about this item in that case would only be that it's sometimes not enough. I'd like some kind of dialog with different levels of cleanup, from the cache of specific modules to the cache of Gradle itself both at the project level and at the GRADLE_HOME level. But now we don't even have that.

Rebuild Project did gradle clean build, where build is a toooo general task that combines everything under the sun. This is indeed a rather useless item, but instead of it the average user would like to see something like gradle clean + build only the selected configuration, without rebuilding tests, all build variants and all that.

If we fantasize about some useful use cases that are missing in terms of hiding Gradle from us, we'd like some quick way to add the --rerun-tasks flag, or --refresh-dependencies. But there's no such thing either.

How many times have these buttons saved us from some code generation that didn't trigger, from random bugs when switching between branches, from a bunch of other problems. And it's not like the overhead is that critical on most projects. And now apparently everyone has to learn to do ctrl+ctrl+manually invoke Gradle tasks or like adults through the terminal. Good luck to beginners.

PS. Updated to Ladybug through Toolbox, settings partially reset. A normal day. 😷