'Getting a loading wrapper properties error in Android

I am getting the following error :

'C:\Users\install\Desktop\project\CoMpC2\gradle\wrapper\gradle-wrapper.properties'.
No value with key 'distributionUrl' specified in wrapper properties file 'C:\Users\install\Desktop\project\CoMpC2\gradle\wrapper\gradle-wrapper.properties'.


Solution 1:[1]

Go to C:\Users\\[Username]\\.AndroidStudio4.0\system\ and delete the caches folder.

After this, create new project and the problem goes away.

Solution 2:[2]

First click on File then-> Project Structure then-> From Project Select any Android Gradle Plugin Version then-> Select any Gradle Version and finally click on Apply -> ok

and then wait for a while until Gradle building finishes...

Solution 3:[3]

While the project is loaded in android studio, go to File then Settings. Under Settings window choose Build,Execution, Deployment then under build tools choose gradle. Click on use local gradle distribution. Change gradle home by browsing gradle location eg.C:/Program Files/Android/Android Studio2/gradle/gradle-2.10

Solution 4:[4]

Just copy this code and paste it in gradle-wrapper.properties (Gradle Version):

#Fri Sep 18 08:52:19 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

Solution 5:[5]

This answer is just an new version of Alok Gupta's Answer

enter image description here

#Tue Oct 16 17:39:45 IST 2018
distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists

zipStoreBase=GRADLE_USER_HOME

zipStorePath=wrapper/dists

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

copy above code inside gradle-wrapper.properties file.

Solution 6:[6]

I faced same error after Android Studio 3.5 update. DisturbutionUrl changes with every gradle plugin update. You can follow this page for lastest gradle plugin version for Android Studio.

Solution 7:[7]

Download latest gradle from gradle website, like 4.6-all.zip, extract it on drive and then go to File then Settings. Under Settings window choose Build,Execution, Deployment then under build tools choose gradle. Click on use local gradle distribution. Change gradle home by browsing gradle location eg.E:/gradle/gradle-2.10.

Don't forget to update below in gradle-wrapper.properties.

distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip

Solution 8:[8]

I had the same / a similar issue. Ideally we should not have to make any changes & Android Studio handles these things automatically.

For some reason some of my configuration got corrupted because of which every time I created a project it failed with these errors and was only putting the Gradle folder in the Project hierarchy and not generating any of the project files.

All I did was delete the .gradle, .android, .AndroidStudiox.x folder in this location: C:\Users\username and the next time I loaded Android Studio it reconfigured those dependencies and got rid of the error.

Solution 9:[9]

C:\Users\[Username]\.AndroidStudio4.0\system\ and delete the caches folder.

After this, create new project and the problem goes away.

Solution 10:[10]

This is an interesting error. For me it seems that android studio is not generating the gradle-wrapper.properties file which it should generate.

As a solution I took a copied a gradle-wrapper-properties file from an old project and copied it into my Gradle Scripts folder.

Also make sure its contents are as below or you can copy the following into that file:

#Mon Nov 22 16:52:32 EAT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

Then try to reload the project or press the try again option that pops up on android studio when you make changes to that file.

After that Android Studio does something strange. It creates a file called wrapper inside Gradle Scripts > Wrapper folder. That folder contains gradle-wrapper.properties. However that file only has comments like the one below.

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains

Again copy the same contents that you copied over from the previous gradle-wrapper properties i.e. the distributionBase=GRADLE_USER_HOME.... into that gradle-wrapper.properties file.

Then reload the project or press the try again/Sync Now button that pops up on top of android studio.

Your project should be in its proper format from there.

And 1 more thing am noting. Now your project is as it should be, however that basic or empty activity or any other activity you created when creating that project is not there and also res>layout is not there.

You can go to File > New > Activity > Empty Activity or Any other activity and those directories should show up now.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cody Gray
Solution 2
Solution 3 P.Githinji
Solution 4 Byte Welder
Solution 5 Vicky Salunkhe
Solution 6 Mete
Solution 7 Waseem Minhas
Solution 8 DGT
Solution 9 Abdullah
Solution 10