android studio 3.0 与 butterknife 配置冲突

android studio从2.0 升级到3.0后,会发现原来的项目会有butterknife 报错,网上也有很多文章说明,试了很多都没有用。

经过一番自我检查与重新配置以后,终于找到解决方法,现将其分享给大家,希望能帮到需要的童鞋。

1.将project 的build.gradle中的插件注释掉,并加入google()

  如下图:

2.将module的build.gradle 的插件注释掉

3. 将下面的2.0配置更改 

compile 'com.jakewharton:butterknife:8.4.0'

扫描二维码关注公众号,回复: 2417635 查看本文章

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

更改为:

implementation'com.jakewharton:butterknife:8.4.0'

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

注意:编译器如果还报错,就删除butterknife配置,从 module Settings重新添加一下即可

4.其他的compile 也更改为implementation

猜你喜欢

转载自blog.csdn.net/huashanjuji/article/details/81005601