Sin*_*ngh 27 android android-studio
我将我的android工作室更新为2.2.现在当我打开并运行上一个项目时,我收到错误UnsupportedMethodException.
Unsupported method: AndroidProject.getPluginGeneration().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model
Run Code Online (Sandbox Code Playgroud)
.
pio*_*543 51
以下是您的问题的一些解决方案.禁用Instant run应该足够了
转到您的build.gradle文件并将gradle-plugin版本更改为:
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
Run Code Online (Sandbox Code Playgroud)
这是通过Android Studio检查即时运行功能的可用性引起的.
通过禁用即时运行来修复它.去:
File -> Settings -> Build, Execution, Deployment -> Instant Run.
Run Code Online (Sandbox Code Playgroud)
并取消选中所有职位
android-apt插件使用此插件也可能导致此问题.
我想这个例子你正在使用Butterknife库.....
注意:如果您使用的是
Jack带有版本2.2.0或更新版本的新编译器,则不需要'android-apt'插件,而是可以annotationProcessor在声明编译器依赖项时替换apt .
转到您的build.gradle文件并删除:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
Run Code Online (Sandbox Code Playgroud)
然后转到您的app/build.gradle文件并删除:
apply plugin: 'android-apt'
Run Code Online (Sandbox Code Playgroud)
然后在同一个文件中,替换现有的:
apt 'com.jakewharton:butterknife-compiler:8.4.0'
Run Code Online (Sandbox Code Playgroud)
同
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
Run Code Online (Sandbox Code Playgroud)
它现在应该工作
| 归档时间: |
|
| 查看次数: |
59636 次 |
| 最近记录: |