3

In proguard-rules.pro, I have following configuration:

-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int d(...);
    public static int i(...);
}

In my gradle build, I enable proguard only for release build:

buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            signingConfig signingConfigs.debug
        }
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

In MyActivity, I have log code:

public class MyActivity extends Activity {
   @Override
    public void onResume() {
        super.onResume();
        Log.d("myTag", "Hello!");
    }
    ...

}

I run my app in release build:

enter image description here

In logcat, I still see the log "Hello!", Why my proguard configuration doesn't remove logs?

Leem
  • 17,220
  • 36
  • 109
  • 159

0 Answers0