'Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-5.4.1-all.zip'
Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-5.4.1-all.zip'
I have just installed Android Studio 3.5 on windows and then created new project then above exception occurs. I have searched on google regarding the above error but none resolved.
Below are the links which I have tried but none worked
- Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip'
- Eclipse -Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-bin.zip'
Is this issue is with Antivirus which is installed in local machine ?.I am just guessing, is this because of Antivirus ?
I was trying with this since 3 days.Please help me on this.Any help would be appreciated.
Solution 1:[1]
I had the same problem and eventually I figured out that running Android Studio as administrator solves it. You can at least give it a try!
Solution 2:[2]
Steps to fix:
- Close Android studio.
- Right click on launcher icon of Android Studio
- Click on "Run as administrator"
- It will run like charm.
Solution 3:[3]
Goto gradle-wrapper
and see carefully the URL
distributionUrl=https \ ://services.gradle.org/distributions/gradle-6.1.1-all.zip
now correct the https \ ://
to https://
and click on "try again upside."
it will took download the file and run automatically.
Solution 4:[4]
Open your gradle-wrapper.properties
and modify your distributionUrl
to point to gradle-5.4.1-all.zip
, i.e.
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Change classpath to 3.5.0
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
...
}
}
Solution 5:[5]
- Close your Android Studio, whatever version you are using.
- Start it again with administrative log in.
- Android Studio will detect what needs to be updated or downloaded.
Automatically it will resolve the issue.
Solution 6:[6]
5.5.1 is out now, try upgrading to that using ./gradlew wrapper --gradle-version=5.5.1
and see if that makes a difference. This is preferable to editing any Gradle files manually.
Solution 7:[7]
For me, i re-downloaded the new and latest version of android studio, installed it full. that solved the problem for me.
Solution 8:[8]
In case the complete error message is something like:
Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-5.4.1-all.zip'.
error in opening zip file
You need to delete two files( under your .gradle/wrapper/dists/*
directory):
gradle-5.4.1-all.zip
gradle-5.4.1-all.zip.lck
Then try again to download dependencies or upgrade.
Solution 9:[9]
Sometimes it might be due to the broken files in .gradle file.
This is an hidden folder in installation directory. Remove the dists folder from this location and go to File -> Invalidate Caches/Restarts.
For me it helped.
rm -rf .gradle/wrapper/dists
Solution 10:[10]
Check if you accidently changed Gradle user home path. Goto Preference in Android studio, search for gradle and check gradle user home path.
It should be like:
/Users/mac/.gradle/
Solution 11:[11]
download gradle 5.4.1 manually from https://downloads.gradle-dn.com/distributions/gradle-5.4.1-all.zip and extract the file and please it in .gralde file in your android project. then restart the android studio
Solution 12:[12]
From: classpath 'com.android.tools.build:gradle:3.2.1'
To: classpath 'com.android.tools.build:gradle:3.5.0'
And the gradle version:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
GL
Solution 13:[13]
I got this error while opening a very old project, the reason was that it was trying to fetch over http and not https. Update the distributionUrl path to https in the path \<project directory\>\gradle\wrapper\gradle-wrapper.properties
and run the android studio in admin mode.
Solution 14:[14]
Please check the value of checksum that you are using in the 'gradle-wrapper.properties' for the version that you are using. It could also be a problem and you get the same error.
Find the value of checksum for the gradle versions at below link:
Solution 15:[15]
1-Create new project on android studio 2-open the new project gradle-wrapper.properties 3-copie the new distributionUrl 4-paste it on your own project 5-click on try again this will correct error
Solution 16:[16]
I got the same issue in new "Android Studio Bumblebee | 2021.1.1" release. Like "Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-gradle-7.2-all.zip'".
I did the following steps,
Step 1:
I did the same steps mentioned here- https://stackoverflow.com/a/59420289/1122622 ,
Like,
- Close Android studio.
- Right click on launcher icon of Android Studio
- Click on "Run as administrator".
Step 2:
Also, verified with official gradle URL- https://services.gradle.org/distributions/ , the given link was right or wrong.
Step 3:
Don't forget to restart the Android Studio once the gradle download was completed.
After all the above 3 steps your issue will be resolved for sure and it will be applicable for upcoming gradle upgrade issue.
Note: Also verify "Do not build Gradle task list during Gradle sync" is enabled, in File->Settings->Experimental->Gradle.
Solution 17:[17]
Just find gradle-wrapper.properties in your IDE. And change version in distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip' to distributionUrl=https://services.gradle.org/distributions/gradle-6.8.3-bin.zip
Solution 18:[18]
we faced this issue because of VPN connection. if you have any VPN connected please turnoff.
Solution 19:[19]
Run as administrator doesn't work for me neither is correcting the URL but when I toggle offline mode and retry, it works!.
Click on "Gradle" at right side of the page then tap on toggle offline mode icon
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow