0

I am trying to run a project and it shows me:

Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest version)

What should I do?

How can I update gradle?

Sufian
  • 6,405
  • 16
  • 66
  • 120
  • Possible duplicate of [Android Studio 2.0 - this version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run](http://stackoverflow.com/questions/36170487/android-studio-2-0-this-version-of-android-studio-is-incompatible-with-the-gra) – Sufian Aug 03 '16 at 14:36
  • Does this answer your question? [How to update gradle in android studio?](https://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio) – Mahozad Jan 23 '22 at 15:28

2 Answers2

3

The gradle plugin is declared inside the build.gradle file in your modules or in your root folder (top-level file).

Use:

 classpath 'com.android.tools.build:gradle:2.0.0'

Also this requires gradle 2.10 (don't confuse the gradle plugin with gradle).
The gradle version is defined in gradle/wrapper/gradle-wrapper.properties.

Use:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
3

For automatic update, you may set the version in Android Studio > File > Project Structure > Project > Android Plugin Version

enter image description here

Please note that you might also need to update Gradle Version. For gradle and gradle plugin compatibility, you may refer to the docs.

Sync gradle afterwards. This will automatically set the distribution URL as well.

vida
  • 4,459
  • 1
  • 22
  • 27