【问题标题】:Version of Android Studio is incompatible with the Gradle Plugin usedAndroid Studio 版本与使用的 Gradle 插件不兼容
【发布时间】:2016-08-20 01:27:05
【问题描述】:

尝试在我的设备(或模拟设备)上运行应用程序时,我不断收到相同的错误:

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)

gradle 构建成功后。

我正在尝试一些 Gradle 设置 - 使用默认 Gradle 包装器,或 使用 Gradle 包装器任务配置 - 没有任何变化。

gradle-wrapper.properties

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

build.gradle

classpath 'com.android.tools.build:gradle:2.2.0-alpha6'

这是来自 github 的开源项目。没有其他人抱怨这一点。

我在 Ubuntu 15.10 上工作,所以 gradle --version 命令可能是有用的信息,

------------------------------------------------------------
Gradle 1.5
------------------------------------------------------------

Gradle build time: niedziela, 16 listopad 2014 16:24:40 UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.4 compiled on January 27 2015
Ivy: non official version
JVM: 1.7.0_95 (Oracle Corporation 24.95-b01)

编辑:哦,我也尝试在配置中禁用 Instant Run
EDIT2:我没有问题与我同时进行的另一个项目,但每个设置都是相同的,所以我真的不知道该怎么做。

【问题讨论】:

  • 你的 android studio 的 gradle 版本和你在项目中使用的版本是什么
  • 我根本没有使用 Anroid Studio - 这是 Intellij Idea 的声明 - 真的很混乱

标签: android gradle gradle-plugin


【解决方案1】:

清理项目并删除构建文件夹...这可能会解决问题。

另外看看this Stack Overflow answer

【讨论】:

    【解决方案2】:

    此问题可能是由 IDE/Gradle 错误引起的!尝试将 Gradle 版本切换到最新版本或降级到稳定版本,

    最新版本:2.2.0-beta2

    最后一个稳定版本:2.1.3

    你也可以试试其他版本,check here

    【讨论】:

    • 与 com.android.tools.build:gradle:2.1.3 一起工作就像魅力一样 - 非常感谢
    猜你喜欢
    • 1970-01-01
    • 2019-12-09
    • 1970-01-01
    • 1970-01-01
    • 2020-01-26
    • 2019-08-01
    • 1970-01-01
    • 2018-11-03
    • 2016-05-14
    相关资源
    最近更新 更多