1

I am using the latest version of Android Studio and have installed the latest version of Gradle from Gradle's website. I then imported some Android sample apps but the build generates an error that reads:

Gradle version 1.10 is required. Current version is 2.1.

I have no idea where it is getting the version 1.10 from. If I open the gradle-wrapper.properties file, I have:

distributionUrl=https://services.gradle.org/distributions/gradle-2.1-bin.zip

I have this problem with every sample I open. Why isn't Gradle using the version I installed? The GRADLE_HOME environment variable is set to the path of the latest version of Gradle.

Even if I run gradlew to force a download of the version of Gradle needed, I still get this error. One post here in SO is:

https://stackoverflow.com/a/23466323/753632

meaning that a specific version of Gradle is required for a specific version of the Android Gradle Plugin, but this was posted some time ago and it isn't clear whether this is an issue anymore.

Community
  • 1
  • 1
Johann
  • 27,536
  • 39
  • 165
  • 279

2 Answers2

0

Try uninstalling gradle and deleting the .gradle folder and then let android studio download gradle instead of installing it manually from the gradle website.

MidasLefko
  • 4,499
  • 1
  • 31
  • 44
0

Try clean and rebuild it will ok most of time.

And if you want to update the version to the latest.

You can try andle

Simple three step to update all project at once.

1. install:

    $ sudo pip install andle

2. set sdk:

    $ andle setsdk -p <sdk_path>

3. update depedency:

    $ andle update -p <project_path> [--dryrun] [--remote] [--gradle]

--dryrun: only print result in console

--remote: check version in jcenter and mavenCentral

--gradle: check gradle version

See https://github.com/Jintin/andle for more information

Jintin
  • 1,426
  • 13
  • 22