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

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

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

  如下图:

android studio 3.0 与 butterknife 配置冲突

 

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

android studio 3.0 与 butterknife 配置冲突

 

3. 将下面的2.0配置更改 

compile 'com.jakewharton:butterknife:8.4.0'

    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

 

相关文章:

  • 2022-12-23
  • 2021-10-29
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2021-11-27
  • 2021-12-20
猜你喜欢
  • 2021-07-27
  • 2021-08-27
  • 2021-04-06
  • 2022-12-23
  • 2021-05-18
  • 2021-06-09
  • 2021-08-30
相关资源
相似解决方案