I am trying to upgrade my Android application but I am getting the following error:
Minimum supported Gradle version is 2.14.1. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in C:\Users\MyUser\Desktop\myproject\gradle\wrapper\gradle-wrapper.properties to gradle-2.14.1-all.zip
This is the line refearing to gradle on build.gradle(Project: myproject)
:
classpath 'com.android.tools.build:gradle:2.1.3'
And I have minSdkVersion
and targetSdkVersion
sets to 16 and 24 respectively.
What I have tried
Option 1: Right click on my project > Open Module Settings Project > Project > Gradle version and setting 2.14.1.
Option 2: Close the IDE, delete gradle folder and restart Android Studio
Option 3: After changing the classpath
to version 2.1.3, I have gone to File > Invalidate Caches/Restart... > Invalidate and Restart
Option 4: I have changed the distributionUrl
property on C:\Users\MyUser\Desktop\myproject\gradle\wrapper\gradle-wrapper.properties to gradle-2.14.1-all.zip
but any of these options work.
What can I do to solve this error?
Thanks in advance!
One way to upgrade the Gradle version is manually change the distributionUrl property in the Wrapper's gradle-wrapper.properties file. The better and recommended option is to run the wrapper task and provide the target Gradle version as described in Adding the Gradle Wrapper.
make sure you use default gradle wrapper.
Open File > Settings (or Android Studio > Preferences... on Mac), in the dialog navigate to Build,Execution,Deployment > Build Tools > Gradle.
then click use default gradle wrapper (recommended) and uncheck offline work.
Change Distribution url to
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
in your gradle-wrapper.properties file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With