Free Up Disk Space Used By Gradle Cache

WARNING: ONLY DO THIS AT YOUR OWN RISK

Steps for Linux-based distros:

  1. Close Android Studio. Ensure that no Gradle daemon instance is running
  2. Determine the location of your Gradle home directory. On Linux, this is typically $HOME/.gradle
  3. Temporarily move your transforms directories to a backup directory:
    mkdir /tmp/gradle-caches
    mv $HOME/.gradle/caches/transforms* /tmp/gradle-caches/
  4. Move file-access.bin file (typically under journal-1):
    mv $HOME/.gradle/caches/journal-1/file-access.bin /tmp/gradle-caches/
  5. Start Android Studio and build your project. If everything works fine, delete  /tmp/gradle-caches