66

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!

Francisco Romero
  • 12,787
  • 22
  • 92
  • 167
  • Have you tried editing the distributionUrl in C:\Users\MyUser\Desktop\myproject\gradle\wrapper\gradle-wrapper.properties to gradle-2.14.1-all.zip? – StenSoft Aug 26 '16 at 10:37
  • @StenSoft Yes, I also have tried it. I forgot to put it on my question but I will edit it now. – Francisco Romero Aug 26 '16 at 10:44
  • What version of Android Studio do you use? – StenSoft Aug 26 '16 at 10:47
  • @StenSoft I am using Android 6.0.1 but the error is shown on Android Studio. – Francisco Romero Aug 26 '16 at 10:52
  • @Error404 http://stackoverflow.com/a/35147471/3395198 – IntelliJ Amiya Aug 26 '16 at 10:55
  • 1
    @IntelliJAmiya I already have looked at your solution before but it also does not work for me. I still continue having the issue. – Francisco Romero Aug 26 '16 at 11:01
  • 1
    @Error404 That's why I asked what version of Android *Studio* do you use – StenSoft Aug 26 '16 at 11:04
  • @Error404 okay .Restart your project (Clean-rebuild) – IntelliJ Amiya Aug 26 '16 at 11:04
  • @Error404 version ?? `2.1.3` ?? – IntelliJ Amiya Aug 26 '16 at 11:05
  • 1
    @IntelliJAmiya I could see that it is the latest (August 2016) [Revisions](https://developer.android.com/studio/releases/gradle-plugin.html#revisions) – Francisco Romero Aug 26 '16 at 11:07
  • 2
    I had the same problem. So I updated Android Studio to version 2.1.3 , then I used the _Fix Gradle Wrapper and re-import project Gradle settings_ option and finally the project was built successfully – Jonnathan Aug 30 '16 at 15:44
  • @Jonnathan Finally I got the solution combining option 1 + option 3 + option 4 but I cannot added it as an answer because it is marked as duplicate. The solution provided by Intellij Amiya did not work for me. – Francisco Romero Aug 30 '16 at 16:15
  • 1
    @Error404 did you get a solution to this issue? I'm having the same. Tried all the mentioned suggestions and answers. Nothing worked. – Manikandan Oct 12 '16 at 04:43
  • 1
    @Manikandan Yes, the solution that I have used is the comment above to your comment but I cannot answer my own question because it is marked as duplicate. I had to combine option1 + option3 + option4 in that order as the comment points out. – Francisco Romero Oct 12 '16 at 11:35
  • **The solution that I got to solve this is just two comments above, but I cannot put it as an answer because it is closed as duplicated.** – Francisco Romero Oct 28 '16 at 14:52
  • 1
    This yould not be marked as duplicated. The solution provided by @IntelliJAmiya does not solve my problem but this http://stackoverflow.com/a/39164527/2734021 response does it – Daniel S. Apr 27 '17 at 13:42

2 Answers2

105

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.

eriuzo
  • 1,687
  • 1
  • 14
  • 16
54

Change Distribution url to

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

in your gradle-wrapper.properties file

Sabish.M
  • 2,022
  • 16
  • 34
  • 29
    It also does not work. – Francisco Romero Aug 26 '16 at 10:44
  • @Chandru I guess that it can be helpful for someone but it did not solved the problem to me. Further, the other solution also does not solved the problem. The solution that worked for me is on the comments as I cannot put it as an answer because the question is closed. – Francisco Romero Nov 13 '16 at 13:44
  • 2
    I have the same problem but i am able to fix it . First we need to delete the gradle folder from your project then try to rebuild it again . It will recreate the same folder now check the gradle-wrapper.properties file you can see the distribution url with wrong gradle version . now change it to 2.14.1-all.zip. rebuild it again. It will work – Jaya Jan 09 '17 at 05:49
  • invalidate and refresh – vihkat Jun 08 '18 at 10:25