qantik
qantik

Reputation: 1097

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?

Upvotes: 39

Views: 26088

Answers (3)

obadia4ever
obadia4ever

Reputation: 11

You can simply delete the ~/.gradle directory. it will rebuild after running flutter build

Upvotes: 0

marc
marc

Reputation: 997

"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

Upvotes: 6

nhaarman
nhaarman

Reputation: 100358

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.

Upvotes: 60

Related Questions