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


i've been building android app using butterknife , upgraded 7.0.1. replaced @injectview , butterknife.inject usage new @bind feature , have no problems debug builds app crashes on startup release builds.

if switch 'minifyenabled' false in build.gradle can generate working release build.

i'm using proguard configuration thats documented on butterknife site doesn't appear working me. i'm using dagger, picasso , flurry in build.

my proguard-rules.pro contents:

# butterknife -keep class butterknife.** { *; } -dontwarn butterknife.internal.** -keep class **$$viewbinder { *; }  -keepclasseswithmembernames class * {     @butterknife.* <fields>; }  -keepclasseswithmembernames class * {     @butterknife.* <methods>; }  # dagger -keepclassmembers,allowobfuscation class * {     @javax.inject.* *;     @dagger.* *;     <init>(); }  -keep class javax.inject.** { *; } -keep class **$$moduleadapter -keep class **$$injectadapter -keep class **$$staticinjection -keep class dagger.** { *; }  # picaso -dontwarn com.squareup.okhttp.**  # flurry -keep class com.flurry.** { *; } -dontwarn com.flurry.** 

we had similar problems after upgrading 7.0.1 got anr instead.

the problem seems because replaced butterknife section of proguard new recommended options butterknife website.

adding -keepnames class * { @butterknife.bind *;} proguard file has fixed our issues.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -