Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ButterKnife error: cannot find symbol method findRequiredViewAsType

I'm using ButterKnife for along time. But I have error which see for first time and didnt find solution for this.

ERROR:

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

I tried bindView like always

@BindView(R.id.menu_hamburgerIcon) ImageView menuHamburger;

Also added in gradle:

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

But still getting this error in genereted class by ButterKnife.

like image 875
Esperanz0 Avatar asked Jul 05 '16 20:07

Esperanz0


1 Answers

You have:

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

but

compile 'com.jakewharton:butterknife:8.0.1'

The trick here is that you must use the same version in both entries and you got 8.0.1 and 8.1.0 (most likely C&P or typo), Just set compile to 8.1.0 too and you should be good:

compile 'com.jakewharton:butterknife:8.1.0'
like image 135
Marcin Orlowski Avatar answered Oct 13 '22 02:10

Marcin Orlowski