How to clear the Gradle cache

Android and JVM builds stash jars and transforms in ~/.gradle. Clearing caches is usually safe; clearing the whole .gradle directory is harsher — know which folder you mean.

Paths that matter

Recommended clear

# Quit Android Studio / Gradle daemons first
rm -rf ~/.gradle/caches/

Or from a project: ./gradlew clean (project only), then optionally wipe the global caches folder above.

Stop daemons first

./gradlew --stop

Stops Gradle daemons so files are not locked mid-delete.

Measure with devdisk

devdisk lists Gradle caches under build caches when present, never deletes, and can emit a cleanup script you review.

curl -fsSLO https://disk.sadana.app/devdisk.py && python3 devdisk.py

Run free scannerSample report

FAQ

Will I need internet after?

Yes — next build re-downloads dependencies. That is expected.

What about Android SDK / emulators?

Separate paths under Android/sdk and AVD folders. Don’t confuse them with Gradle caches; they are larger and slower to restore.

Windows path?

%USERPROFILE%\.gradle\caches