This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Ru
来源:互联网 发布:淘宝cpu散片会挑体质吗 编辑:程序博客网 时间:2024/04/26 10:44
1.配置
本人as 2.2,gradle插件依赖也是对应的
classpath 'com.android.tools.build:gradle:2.2.0'
在github上clone一个开源框架,在as运行时,报出了如下的错误
Error running MPChartExample: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)
2.解决
其实解决这个问题的方法有很多。
1.最简单的当然是去设置里面将Instant Run,取消勾选,然后clean–>rebuild下就可以了。但是我想保留Instant Run,所以没采取这种。
2.说白了导致这种情况的原因是对方使用的是as2.3版本的,然后clone导入到as时,选择使用他设置的gradle版本插件,和你的不相符合,所以才发生错误。这样,直接将as升级打动2.3就ok了,当2.3后也可以相应的使用as2.3对应的gradle版本插件了,如下(这是在整个project下的build.gradle中,注意不是app模块下的)
// classpath 'com.android.tools.build:gradle:2.3.0'
如果你只是as2.2版本,是不能使用这个版本的gradle插件的。所以步骤就是升级as,修改build.gradle的版本,从
classpath 'com.android.tools.build:gradle:2.2.0'
改成
classpath 'com.android.tools.build:gradle:2.3.0'
(稍微注意下,你自己的gradle插件不一定是2.2.0,直接看下平常可以运行的项目,是多少就是多少,但是反正不会是2.3.0)
在然后看看
\gradle\wrapper\gradle-wrapper.properties
这个文件中最下面一行的代码是不是
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
他,一般是它,2.3as生成的工程都是这个版本号
剩下的无非是clean build,但是我不想升级as,所以这种方法也没用了。
3. 第三种方法和刚刚相反,上面第二种是我们去配合他,现在不想这样做,就只有他配合我们,将所有的东西版本号改成我们能用的,
将build.gradle从2.3.0改成2.2.0,将gradle-wrapper.properties中的最后一行代码改成平常你项目中能运行的版本好,然后clean build 就可以了。
当然 最后这种可能有隐患,如果项目中含有2.3的东西,可能导致不兼容,我只碰到过一次,其他的都没问题,如果真的有,那没办法了,只能用上面两种办法了。
ok 希望能帮到你!!
- This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Ru
- this version of Android Studio is incompatible with the Gradle Plugin used. try disabling Instant Ru
- This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Ru
- This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Ru
- This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant R
- This version of android studio is incompatible with the gradle version used.Try disabling the instan
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try
- Studio运行出现:This version of Android Studio is incompatible with the Gradle Plugin used. Try disablin
- Error running app: This version of Android Studio is incompatible with Gradle Plugin used.Try disabl
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- Error running app: This version of Android Studio is incompatible with the Gradle Plugin used. Try d
- UVA
- JS总结——运算符
- java中的反射
- 2017-09-10 LeetCode_018 4Sum
- Appium基础篇10-元素定位之by_accessibility_id
- This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Ru
- HBase入门基础教程 HBase之单机模式与伪分布式模式安装
- selenium页面元素定位方法
- 如何实现一个简单的Vue移动端组件库
- luoguP1972 [SDOI2009]HH的项链(莫队)
- sklearn.datasets.fetch_20newsgroups英文文档翻译
- Python 编写windows守护进程程序
- 点击按钮复制链接
- 《Netty学习》(五)ChannelPipeline学习