简体   繁体   中英

How to update Gradle Plugin version?

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?

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

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

在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM