7

I get the following error when I am trying to import the project.

Unable to get Gradle wrapper properties from: F:\projects\Polyfills\cordova\platforms\android\gradle\wrapper\gradle-wrapper.properties

Would you like to recreate the wrapper using the latest supported Gradle version?

Click 'OK' to recreate files, or 'Cancel' to manually set the path of a local Gradle distribution.

shizhen
  • 12,251
  • 9
  • 52
  • 88
Bikash Saha
  • 71
  • 1
  • 1
  • 3

3 Answers3

3

It seems like the distributionUrl is missing in gradle-wrapper.properties of your project. gradle-wrapper.properties looks like as follows . please check your path and add distributionUrl inside gradle-wrapper.properties file

#Thu Dec 13 11:43:04 JST 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

Possible Solution

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. ... /gradle/gradle-2.10

Farid Haq
  • 3,728
  • 1
  • 21
  • 15
  • 2
    In my project folder gradle folder is missing so there is no gradle-wrapper.properties where I can make the edit. I downloaded the package from pwabuilder.com @manifoldjs About your Possible Solution, I did that, and now I am getting error as ERROR: Gradle version 2.2 is required. Current version is 4.10.1. Please fix the project's Gradle settings. Fix Gradle wrapper and re-import project Gradle settings – Bikash Saha Feb 01 '19 at 19:11
1

Goto Settings into Android Studio then Build, Execution, Deployment > Build Tools > Gradle. Then in Use Gradle from, select Specified location, meanwhile select your project app location from your project. Solution

Christopher Nolan
  • 930
  • 1
  • 11
  • 15
0

I was working on a Cordova project and faced the same issue, which was fixed by upgrading android platform version, like below:

cd ./cordova && cordova platform add android@10.0.0
Pei
  • 11,452
  • 5
  • 41
  • 45