ERROR: Could not install Gradle distribution from ‘ https://services.gradle.org/distributions/gradle

When you create a new project or import a project, gradle errors often appear, because this is a file on a foreign website, and the download is too slow, resulting in the download failure. This kind of problem is very common, so I'd like to summarize it. When you encounter this problem in the future, you can directly apply the right medicine to the case and cure the disease!

ERROR: Could not install Gradle distribution from 
'https://services.gradle.org/distributions/gradle-5.4.1-all.zip'.

1. Because this is the first time to run the project, you need to download gradle. The download speed of the Internet is too slow, resulting in failure. We need to find our own gradle directory first. The default is C: \ users \ user \. Gradle \ wrapper \ dists. The user here is your own user name.

You can see that the first gradle here is the file that Android just failed to download, which can be seen by modifying the time. The second is the gradle file I've been using for Android. (you only have the first file)

PS:你在网上找到的都是收费的,我的是免费的,这不点个赞支持下良心博主嘛。

3. After downloading and decompressing, just follow the following tutorial.

1. If you have run Android projects before, you must download the gradle. It's not the problem of whether there is a gradle, but that the gradle path is not written correctly. So go directly to the settings of Android studio and change the directory.

First, find the location of your own gradle, which is under C: \ users \ user \. Gradle \ wrapper \ dists by default. If you see multiple gradles of the same version, only keep the gradle you have previously used, and delete the gradle that has just failed to download, which can be seen by modifying the date.

2. Open Android studio, file - > Settings - > gradle - > build, execution, deployment - > gradle - > Global gradle settings. Here is the location for global configuration of gradle, that is, you will find gradle from this path by default in the future, and select your own path according to the following figure.

4. After making changes, select File - > sync project with gradle files, and the project will be built successfully.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>