Bottom Line: It is safe to delete the .gradle/caches folder. Gradle will automatically re-download any required dependencies the next time you build your Android Studio or Java project.
What is the Gradle Cache Folder?
Located at ~/.gradle/caches on macOS/Linux or %USERPROFILE%\.gradle\caches on Windows, this folder is created by the Gradle build tool (widely used in Android development, Kotlin, and Java projects).
Whenever you build an Android app or Java project, Gradle downloads required SDK dependencies, Maven libraries, and wrapper jars into .gradle/caches. Over time, as dependency versions change, older versions remain stored in the cache forever. It is common for .gradle/caches to grow to 10 GB to 20 GB+.
Can You Delete .gradle/caches?
✅ Yes, it is safe to delete.
- Zero project damage: Your project source code, Android layout XMLs, and Gradle scripts (
build.gradle) are completely safe in your project folders. - Initial rebuild time: The first build after clearing the cache will take slightly longer because Gradle will re-download the active dependencies from Maven Central or Google Maven.
How to Safely Clean Up Gradle Cache
Method 1: Delete the Caches Subfolder (Recommended)
To delete cached jars and dependencies without losing your Gradle global configuration settings (gradle.properties):
# macOS / Linux
rm -rf ~/.gradle/caches
# Windows (Command Prompt)
rmdir /s /q %USERPROFILE%\.gradle\caches
# Windows (PowerShell)
Remove-Item -Recurse -Force $env:USERPROFILE\.gradle\caches
Method 2: Use Android Studio Built-in Clean
- In Android Studio, click File > Invalidate Caches….
- Check Clear file system cache and Local History.
- Click Invalidate and Restart.
Related Guides
- Learn about deleting node_modules folders.
- How to clean up [Maven .m2)))))))))) repository].
- Check if you can clear Android .obb files.
Discussion
Loading authentication...