Impact to ButterKnife from – Resource IDs will be non-final in Android Gradle Plugin version 5.0, avoid using them as annotation attributes

I’m using annotated attributes all over my Android project to bind Views and events to fields and methods.

@BindView(R.id.textViewOrderId)
TextView textViewOrderId;

@OnClick(R.id.buttonDateFilter)
public void onButtonDateFilter(View view) {...}

Migrating out of ButterKnife has become a bit expensive now. I would like to clarify a few things about this new Gradle Plugin change,

  • How will non-final resource id’s would affect my current project?
  • Will I have to migrate from ButterKnife for good if I update the Gradle Plugin?
  • What is the class R2 mentioned in this Reddit post?

Source: Android Studio Questions

LEAVE A COMMENT