For enabling ProGuard configurations for your application you need to enable it in your module level gradle file. you need to set the value of minifyEnabled true.
You can also enable shrinkResources true which will remove resources that ProGuard flaggs as unused.
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
The above code will apply your ProGuard configurations contained in proguard-rules.pro ("proguard-project.txt" in Eclipse) to your released apk.
To enable you to later determine the line on which an exception occurred in a stack trace, "proguard-rules.pro" should contain following lines:
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
To enable Proguard in Eclipse add proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt to "project.properties"