Android Studio gradle manual download configuration

When synchronizing projects, sometimes you will encounter the problem that the first step of downloading gradle in Android Studio is a connection failure.

In this case, we can manually download the gradle file from the gradle official website and place it in the cache directory of Android Studio, so that AS will automatically decompress the downloaded file when synchronizing the code.

Proceed as follows:

1. Download the file:

Gradle | Releases

Select the gradle version you want at this current address. Please pay attention to whether it is binary-only (bin) or complete (all) as follows.

In the gradle-wrapper.properties file in the android project, you can see whether to download bin or all. Of course, this can also be changed. The package size of bin should be smaller.

2. Migrate the specified directory

Windows operating system, move the downloaded zip file (such as gradle-8.2.1-all.zip) to the following folder

C:\Users\你的用户名\.gradle\wrapper\dists\gradle-8.2.1-all\随机字符串\

Below the folder as shown below

If you find that this folder does not exist, synchronize the following items first, and AS will automatically create it for you.

3.sync project

After synchronizing the project, AS will automatically decompress the compressed package and proceed to the next steps.

Guess you like

Origin blog.csdn.net/u012218652/article/details/133810148