ButterKnife error: cannot find symbol method findRequiredViewAsType
Asked Answered
D

1

5

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.

Deathly answered 5/7, 2016 at 20:37 Comment(0)
D
12

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'
Descent answered 5/7, 2016 at 20:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.