Tek Eye Logo

Tek Eye

How to Move Gradle Folder for Android Studio

This article is about moving the Gradle directory, .gradle, used by Android Studio, from the default location to another drive. This can be required when a disk drive runs low on space. The .gradle directory can grow to several gigabytes in size as Studio and Gradle gets updates. Another reasons to move the .gradle directory is to try and keep the build process all contained in one location (e.g. if the app project files are on another drive).

Android Studio Starting

On some Windows computers the C: drive may be low on space. This means programs and files may need to be installed and run from another drive. It is not uncommon for a computer to have a small Solid State Drive (SSD) for the operating system (OS), usually the C: drive, and a larger second drive, usually D:, for data and large programs.

Where is .gradle Folder in Windows?

The default location for the files for a Windows user is under the Users directory on the C: drive. So a user called John Doe would have a folder at C:\Users\John Doe. This user directory is where the Windows .gradle folder is located.

Can I Move Android Studio's .gradle Folder to Another Disk?

Android Studio has a setting that can be changed so that Gradle can be located on another drive. With Android Studio running, close any open projects to return to the Welcome to Android Studio dialog. This will prevent any background project tasks getting confused when moving the .gradle folder.

In Windows File Explorer move the .gradle folder to the new location. Move by either by dragging and dropping while holding the Shift key, or using the File Explorer context menu (normally right-click) and selecting cut, and then paste to the new location. Next access the Settings for the Android Studio.

Studio Welcome Screen Settings

The Global Gradle Settings are under Build, Execution, Deployment in the Build Tools section. Choose the new location of the moved .gradle directory.

Android Studio Gradle Settings

Open an app project and check that the project builds correctly to confirm that the Gradle move was successful.

Delete .gradle Folders

At the time of writing this article the version of Gradle used by Studio was over version 4, with version 5 under development. This means older versions are unlikely to be used again. Thus older versions of Gradle in the .gradle folder can be deleted if no longer required. E.g. delete all 1.x folders under the caches and daemon .gradle sub-folders, and delete all gradle-1.x-all and gradle-1.x-bin under .gradle/dists.

Android Logo

See Also

Author:  Published:  

ShareSubmit to TwitterSubmit to FacebookSubmit to LinkedInSubmit to redditPrint Page

Do you have a question or comment about this article?

(Alternatively, use the email address at the bottom of the web page.)

 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.


Articles on:

Android Programming and Android Practice Projects, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS, C# Programming, Using Windows for Programming


Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples



Tek Eye Published Projects