How to modify the storage location of the .android/.gradle folder of Android Studio?

① First, we close Android Studio (skip this step if it is not started);
② Then we create a new folder in the target location to store the .android/.gradle folders that were originally located in the user directory. Take a folder as an example;
[Note: It is recommended that no spaces be left in the folder name]
insert image description here

③Move the two folders .android/.gradle originally located in the user directory to the newly created folder;
insert image description here

④ Next, we enter the edit interface of **Windows System/Environment Variables**;
[Don’t know how to enter the edit interface? Take a look at this tutorial: Portal ]
⑤ Add the following system variables and save:
Variable name: ANDROID_SDK_HOME Variable value: E:\Android_Studio_Data\
Variable name: GRADLE_USER_HOME Variable value: E:\Android_Studio_Data\ .gradle
insert image description here

⑥ Then we start Android Studio, open the Gradle settings in File -> Settings -> Gradle , change the Gradle user home path to the current path E:\Android_Studio_Data.gradle, and click Apply.
insert image description here

Guess you like

Origin blog.csdn.net/azurekiln/article/details/130173527