Whats new in Butterknife 8.5 ?


Hello Droiders !!!

I am sure, you all have been using Butter Knife, and I know you love it. Many Thanks to Jake Wharton, for writing such a beautiful library.

Took few minutes to update with you all with a small update.

Butter Knife just got updated to 8.5.1 (by the time I am writing this blog).

How to integrate it ?

1. Add the plugin to your build.gradle (Project):

buildscript {
repositories {
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'

2. Apply this in your module in build.gradle(Module: app) as:

apply plugin: 'com.jakewharton.butterknife'

Then Add below as dependencies:

dependencies {
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

Whats new in it ?

Well, change is in the way we use it.

Previously, we used R in ButterKnife annotations, lets say,

@BindView(R.id.textView) TextView mTextView;

Now, we simply have to use R2 in ButterKnife annotations as,

@BindView(R2.id.textView) TextView mTextView;

As far as I can understand, this new library is going to maintain its own version of mapping of ids, its own R.java (R2).


For the one who just cares about using it, there’s no major change, just use R2 instead of R.

To learn advanced usages of Butter Knife, visit the awesome blog post Android — Get more out of Butter Knife by Paresh Mayani.

Thanks for visiting…!!!

Show your support

Clapping shows how much you appreciated Chintan Soni’s story.