Diskzyv0.1
Delete with care

What is ~/.gradle/caches on Mac? Is it safe to delete?

Short answer

You can delete ~/.gradle/caches without breaking anything, but it costs time. The next build of each project downloads its dependencies again and rebuilds from scratch.

Where it is

~/.gradle/caches

What it is

Gradle, the build tool behind Android and many Java and Kotlin projects, stores downloaded libraries, transformed artifacts and reusable build outputs in ~/.gradle/caches. Sharing them between projects is what keeps everyday builds fast.

It grows with every Gradle version and every dependency version your projects use. Gradle removes cache entries that have not been used for a while by itself, but on an active machine the folder still gets large.

Next to it, ~/.gradle/wrapper holds the Gradle distributions that projects downloaded, and ~/.gradle/daemon holds logs.

How big it gets

Often several GB, and more than ten GB on a Mac used for Android development.

How to clear it by hand

  1. Close Android Studio or IntelliJ IDEA.
  2. Stop running Gradle daemons from a project folder with ./gradlew --stop, so nothing holds the cache open.
  3. Run the command below. It deletes the whole caches folder.
  4. Open a project and build once while you have a good connection, since everything is downloaded again.
In Terminal
rm -rf ~/.gradle/caches

What happens afterwards

The first build of each project is much slower than usual and needs the network to fetch every dependency. After that, builds return to normal speed as the cache fills again.

How Diskzy handles it

Diskzy lists Gradle caches in the Clean up tab but leaves them unticked, because the next build will be slow.

Related guides

See where your Mac's space went

Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.

Try Diskzy for free
Read this in:EnglishEspañolDeutschPortuguêsFrançaisTürkçe日本語