How to uninstall Gradle on a Mac, and the cache that is twice its size
Remove Gradle with Homebrew, then the ~/.gradle folder that every project and Android Studio fill: on our Mac 992 MB, nearly twice Gradle itself.
How do I uninstall Gradle on a Mac?
brew uninstall gradleOurs, Gradle 9.1.0 from Homebrew, was 519 MB. If you installed it from a zip, remove the folder you unpacked and its line in your shell file.
What is the .gradle folder, and can I delete it?
~/.gradle holds downloaded dependencies, build caches and Gradle versions that projects fetched for themselves through the Gradle wrapper. Ours was 992 MB. Deleting it is safe: projects download what they need again, slowly, on their next build.
Does uninstalling Gradle break Android Studio?
No. Android projects use the Gradle wrapper, which downloads its own copy into ~/.gradle. On our Mac Android Studio itself had already been removed, and its projects' share of ~/.gradle was still there.
More on the folder: the .gradle folder taking up space. Maven keeps a similar cache: uninstall Maven.
Common questions
How do I uninstall Gradle on a Mac?
Run brew uninstall gradle, then move ~/.gradle to the Trash if you want its caches gone too.
Is it safe to delete the .gradle folder?
Yes. It is a cache; projects download what they need again on their next build.