AnnotationTypeMismatchException in Butterknife @BindView with layouts defined in another folder structure

673 Views Asked by At

While working on a project recently, As the layouts was adding up so many xml's, I added subfolders to layout resources to make the project structured, But after that ButterKnife Injections are not working. I am getting the following error.

@BindView(R.id.tb_tvcoinsMainCommon) TextView tvCoins;
                     ^
  
java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract int butterknife.BindView.value() (Found data of type <any>)

findViewById() is not giving any issues, only ButterKnife Bindings are giving issues. If anybody has a solution that would be helpful

1

There are 1 best solutions below

0
Rithik Sabhal On

Thanks for looking into this, the issue was the code was not able to find the xml files from the new layout directory. The build.gradle file was missing the correct resource folder configuration. The gradle file and the project structure looks like this after solving

New layout files structure