解决升级AS3.0+ Gradle4.0+ 使用ButterKnife apt报错问题

来源:互联网 发布:creis中指数据 登录 编辑:程序博客网 时间:2024/05/21 07:53

这是报错详情-> Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use ‘annotationProcessor’


原因是AS3.0之后对以前的apt什么的不兼容了。
首先:
1.删除工程根目录下build.gradle中dependencies 内

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

2.删除app目录中build.gradle中

apply plugin: 'com.neenbedankt.android-apt'

最后:

将app目录中build.gradle中dependencies内

apt 'com.jakewharton:butterknife-compiler:8.8.1'

改为

annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

之后try again

以后用ButterKnife又方便点了,少了两步

阅读全文
0 0
原创粉丝点击