ButterKnife错误:找不到符号方法findRequiredViewAsType

希望

我一直在使用ButterKnife。但是我有错误,这是第一次看到,并没有为此找到解决方案。

错误:

Error:(24, 36) error: cannot find symbol method findRequiredViewAsType(Object,int,String,Class<ImageView>)

我像往常一样尝试了bindView

@BindView(R.id.menu_hamburgerIcon)ImageView菜单

还添加在gradle中:

   compile 'com.jakewharton:butterknife:8.0.1'
    apt 'com.jakewharton:butterknife-compiler:8.1.0'

但是在ButterKnife的特级课堂上仍然遇到此错误。

马尔辛·奥尔洛夫斯基(Marcin Orlowski)

你有:

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

compile 'com.jakewharton:butterknife:8.0.1'

这里的窍门是,您必须在两个条目中使用相同的版本,并且您已经获得8.0.18.1.0(很可能是C&P或错字),只需将其设置compile8.1.0太,您就应该很好:

compile 'com.jakewharton:butterknife:8.1.0'

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章