I am trying to remove logging from the release apk file. I followed the advice of using BuildConfig.DEBUG
variable, which will be true for debug builds and false otherwise.
In a Constants file, I have:
public static final LOG_ENABLED = BuildConfig.DEBUG;
And then I check the variable before logging.
if(Constants.LOG_ENABLED){
// print Log
}
Then, in the gradle
build file, I have added android
{ buildTypes { release { minifyEnabled true shrinkResources true } } }
. I then ran gradle assembleRelease
, but the logging still remains inside the apk file?
Can someone kindly show me the error of my ways?