Android Studio gradle download failed? ! Use local gradle, use gradle offline

The first project after the installation of Android Studio is often to download gradle, and the download of gradle is sometimes very slow. There are two solutions:

 

The first is to place the downloaded gradle-xxx-all.zip in the specified directory:


Path under Windows: C:\Users\your user name\.gradle\wrapper\dist\gradle-xxx-all\*********\

Path under Linux: /home/your username/.gradle/wrapper/dist/gradle-xxx-all/*********/

Path under MacOS: /Users/your username/.gradle/wrapper/dist/gradle-xxx-all/*********/

 

"*********" is a folder of strings

The xxx of gradle-xxx-all refers to the gradle version number, such as:

Android Studio 4.0.1 corresponds to gradle-6.1.1-all

Android Studio 3.6.3 corresponds to gradle-5.6.4-all

Android Studio 3.5.3 corresponds to gradle-5.4.1-all

 

First, clear all the files in the above directory, and then put gradle-xxx-all.zip in, do not unzip, Android Studio will automatically unzip it.

Where to download gradle-xxx-all.zip, follow the official account "Android hard development" and reply "gradle" to check the download address.

 

The second method is to use Alibaba Cloud's Maven library. You can read the previous article, which can solve most of the problems:

The solution to 90% of the first Android project is here: sync failed, unresolved, not found...

Guess you like

Origin blog.csdn.net/Lwjobs/article/details/108280620