我一直在使用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的特级课堂上仍然遇到此错误。
你有:
apt 'com.jakewharton:butterknife-compiler:8.1.0'
但
compile 'com.jakewharton:butterknife:8.0.1'
这里的窍门是,您必须在两个条目中使用相同的版本,并且您已经获得8.0.1
和8.1.0
(很可能是C&P或错字),只需将其设置compile
为8.1.0
太,您就应该很好:
compile 'com.jakewharton:butterknife:8.1.0'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句