During actual operation, gradle may not be able to download or download slowly due to various reasons. At this time, we can download it manually or find a recent version to replace it.
Confirm the version to download
Whether you compile Android projects with commands or Android studio, you can see from the log that you want to download the version of gradle, copy the address and use it later.
Is to download the above version and the file corresponding to the copied address. You can use tools such as Xunlei to speed up the download.
Where will it be?
Gradle files are generally placed in the user’s home directory. The path is:
. gradle / wrapper / dists / here is the version / here is the random string/
The. Gradle folder is generally a hidden folder. You can enter the directory directly by entering the address in the manager or the command line.
To delete other files, you only need to put the downloaded files in the directory, do not unzip or change their names.
Note: the paragraph “here is a random string” may change. What does this mean? It means that different projects may need the same gradle version, but the path of “here is a random string” generated after the version is different, so it is necessary to download gradle again. If you view the same version, The path of “here is a random string” is different, but the file has been downloaded in other paths. You can directly copy the downloaded file to a new path, so you don’t have to download it again.
After the manual download is completed, when compiling the project using the command line or Android studio, you can see that he does not need to download gradle. He will decompress it directly for subsequent compilation.
How to replace with the latest version
For example, we need gradle 5.1 now, but we don’t want to download it, and there is gradle 5.0 locally, so we can directly copy the zip package in gradle 5.0 directory to gradle 5.1 directory. This can be done only when the version difference is small.
We also provideSupporting videoTutorial, 1-to-1 Q & A, course design, completion design, project customization and development services.