Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to delete old Gradle versions?

I recently noticed that the .gradle folder in my home directory blew up to a size of almost 2GB. This is mainly caused by the all the old versions located at .gradle/wrapper/dists.

I'm currently running v3.0 so is it necessary to keep all those other binaries and would there be a possible conflict with AndroidStudio which itself runs an internal Gradle wrapper at v2.2.0?

like image 397
qantik Avatar asked Sep 20 '16 20:09

qantik


People also ask

Is it safe to delete gradle folder?

Don't delete the entire . gradle directory when a build error · Issue #92469 · flutter/flutter · GitHub.

Is it safe to delete gradle caches?

gradle/caches directory holds the Gradle build cache. So if you have any error about build cache, you can delete it.

Is it safe to delete gradle wrapper?

You can safely delete the ~/. gradle directory. It is created by the Gradle wrapper to store and cache downloaded files, so it will just repopulate the folder with the files necessary for future builds. Note that if you made any changes yourself in that directory, you may need to keep those files, such as a ~/.


2 Answers

You can safely delete the ~/.gradle directory. It is created by the Gradle wrapper to store and cache downloaded files, so it will just repopulate the folder with the files necessary for future builds.

Note that if you made any changes yourself in that directory, you may need to keep those files, such as a ~/.gradle/gradle.properties file.

like image 134
nhaarman Avatar answered Sep 27 '22 23:09

nhaarman


"Periodic cache cleanup" had been added in Gradle 4.10-rc-1 to solve this issue, for details, see: Gradle 4.10-rc-1 release-notes

like image 38
marc Avatar answered Sep 27 '22 21:09

marc