Quick answer
Stop the daemon with ./gradlew --stop, check sizes with du -sh ~/.gradle/* | sort -h, then delete ~/.gradle/caches and the old versions in ~/.gradle/wrapper/dists. Gradle downloads what it needs on the next build, which will be slower once. Typical savings: 5 to 40 GB.
Where the space goes
Step 1: Stop the Gradle daemon
A running daemon keeps files in the cache open. Stop it first, from any Gradle project:
./gradlew --stopOr run gradle --stop if Gradle is installed with Homebrew. Close Android Studio too.
Step 2: See what’s using the space
du -sh ~/.gradle/* 2>/dev/null | sort -h
du -sh ~/.gradle/caches/* ~/.gradle/wrapper/dists/* 2>/dev/null | sort -hcaches is usually the biggest folder. wrapper/dists has one folder per Gradle version you’ve used.
Step 3: Delete the caches
To clear only the build cache and keep downloaded dependencies:
rm -rf ~/.gradle/caches/build-cache-1To clear everything Gradle has cached:
rm -rf ~/.gradle/caches~/.gradle/gradle.properties or ~/.gradle/init.d. They hold your settings and signing configuration, not cache.Step 4: Remove old Gradle versions
List the wrapper distributions, then delete the versions your projects no longer use:
ls ~/.gradle/wrapper/dists
rm -rf ~/.gradle/wrapper/dists/gradle-7.6-binA project that still needs that version will download it again on its next build.
Step 5: Clean old project builds
Each project also keeps a build folder per module and a .gradle folder. Run this in projects you’re not actively working on:
./gradlew cleanFor emulator images and the Android SDK, see Android Emulator disk space on Mac.
Clear Gradle and other build caches with SpaceWise
SpaceWise scans Xcode, Docker, node_modules, Gradle, Homebrew, package manager caches and local AI models, groups them by project, checks git status and lockfiles before it suggests anything, and moves what you approve to the Trash so you can undo it. The scan is free on Mac and Windows.
Find your Gradle and Android caches
Run a free scan to see Gradle caches, wrapper versions and other build caches with their sizes.
Download for MacFAQ
Is it safe to delete the Gradle cache?
Yes. ~/.gradle/caches only holds downloaded dependencies and build outputs that Gradle can recreate. Stop the daemon first, and expect the next build to take longer while dependencies download again.
Where is the Gradle cache on Mac?
In your Gradle user home, ~/.gradle by default (/Users/<you>/.gradle). Dependencies are in ~/.gradle/caches/modules-2, the build cache in ~/.gradle/caches/build-cache-1, and Gradle versions in ~/.gradle/wrapper/dists. The GRADLE_USER_HOME variable can move it.
Does Invalidate Caches in Android Studio clear the Gradle cache?
No. File > Invalidate Caches clears Android Studio's own IDE caches and indexes. The Gradle cache in ~/.gradle stays until you delete it.
How do I clear the Gradle cache for React Native or Flutter?
Run ./gradlew clean inside the android folder to remove the project build, then delete ~/.gradle/caches for the shared cache. Flutter also has flutter clean for its own build folder.
Does Gradle clean its cache automatically?
Partly. Recent Gradle versions remove cache entries that haven't been used for a while, and the retention period can be changed with an init script. Old wrapper distributions and very active caches still grow, so a manual clean helps.
Run this cleanup in SpaceWise
Same targets, Recovery Bin rollback, no Terminal required. Free tier included.