본문 바로가기
#모바일 [Mobile]/Android

[Android] ButterKnife Proguard 설정하기 (How to configure Proguard settings for ButterKnife?)

by cy_mos 2019. 8. 1.
반응형

📄 build.gradle Source Code

android 
{
    	...

    lintOptions {   disable 'InvalidPackage' }

    packagingOptions { exclude 'META-INF/services/javax.annotation.processing.Processor' }

	...
}

📄 ProguardFiles [proguard-project.txt, proguard-rules.pro] Source Code

# butter knife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }

-keepclasseswithmembernames class * {
    @butterknife.* <fields>;
}

-keepclasseswithmembernames class * {
    @butterknife.* <methods>;
}

🚀 REFERENCE

 

Butter Knife

Introduction Annotate fields with @BindView and a view ID for Butter Knife to find and automatically cast the corresponding view in your layout. class ExampleActivity extends Activity { @BindView(R.id.title) TextView title; @BindView(R.id.subtitle) TextVie

jakewharton.github.io

 

Howto configure ProGuard settings for ButterKnife 8?

I am running ButterKnife version 8.5.1 in my Android app. If I try to make ProGuard settings for ButterKnife I still got crashes in my release version. There is an issue on the official ButterKnife

stackoverflow.com

 

ButterKnife proguard 설정.

build.gradle 설정. lintOptions { disable 'InvalidPackage' } packagingOptions { exclude 'META-INF/services/javax.annotation.processing.Processor' } proguard 설정. # butter knife -keep class butterkni..

lsit81.tistory.com

 

반응형

댓글