I have an error in Android ButterKnife, using androidx instead of android
java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview.widget.RecyclerView$LayoutManager)' on a null object reference build.gradle(project)
classpath 'com.android.tools.build:gradle:3.2.1'
build.gradle(app)
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
and error in fragment
@BindView(R.id.recyclerViewProduct)
RecyclerView recyclerViewProduct;
private Unbinder unbinder;
inflating view
View view = inflater.inflate(R.layout.fragment_product, container, false);
unbinder = ButterKnife.bind(this, view);
I got an error here
recyclerViewProduct.setLayoutManager(mLayoutManager);
and i unbind
@Override
public void onDetach() {
unbinder.unbind();
super.onDetach();
}