Search code examples
androidandroid-studiogradlebuild-tools

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?


Solution

  • 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.