在项目打包调试过程,遇到提示这样的错误
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)
翻译一下:错误运行应用程序:这个版本的Android工作室与Gradle插件不兼容使用。尝试禁用即时运行(或更新IDE或Gradle插件的最新版本)。
**解释造成这种现象,
`一般是android studio ide升级或者Gradle插件升级到最新的版本。我的是android studio版本升级导致的。
解决方案
新建一个app,找到app/build.gradle,复制 如;classpath ‘com.android.tools.build:gradle:2.2.3’替换原有报错的项目classpath配置
替换如下:
buildscript {
repositories {
jcenter()
}
dependencies {
// classpath 'com.android.tools.build:gradle:2.3.0-alpha2'
// classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}