Why does Butterknife @Bind fail in release build (after proguard) Why does Butterknife @Bind fail in release build (after proguard) android android

Why does Butterknife @Bind fail in release build (after proguard)


We had similar problems after upgrading to 7.0.1 but we got an ANR instead.

The problem seems to be because we replaced the Butterknife section of Proguard with the new recommended options from the ButterKnife website.

Adding -keepnames class * { @butterknife.Bind *;} to the proguard file has fixed our issues.


From the website, http://jakewharton.github.io/butterknife/ this seemed to work for me:

-keep class butterknife.** { *; }-dontwarn butterknife.internal.**-keep class **$$ViewBinder { *; }-keepclasseswithmembernames class * {    @butterknife.* <fields>;}-keepclasseswithmembernames class * {    @butterknife.* <methods>;}