1

I realize all my logging effect (Log.i) disappear, when I deploy my app through APK using Android Tools -> Export Signed Application Package...

Even after my ProGuard had commented out logging related configuration

#-assumenosideeffects class android.util.Log {
#    public static *** d(...);
#    public static *** v(...);
#    public static *** i(...);
#}

Is there any settings I had missed out? I wish logging effect is still there, even I export my ProGuard processed as a APK file.

This is because I would like to debug some crashing problem caused by ProGuard.

Community
  • 1
  • 1
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
  • Can you simply temporarily raise your `Log.i()` calls to `Log.w()` or `Log.e()` instead? – CommonsWare Jan 19 '13 at 17:15
  • Replacing `Log.i()` with `Log.w()` or `Log.e()` doesn't help much. The only different is, I create 2 APKs with and without `proguard.config=proguard-project.txt` in project.properties. Both are having `android:debuggable="true"` in `AndroidManifest.xml`. The one with proguard enabled print out nothing. – Cheok Yan Cheng Jan 20 '13 at 07:35

1 Answers1

1

ProGuard doesn't spontaneously remove any logging code. As the symptoms of one of your other questions today ("keep class and keep interface in proguard doesn't work as expected") suggests, you should double-check that you're editing the correct configuration file (proguard-project.txt, as of Android SDK r20) and that you're looking at the output of a successful build.

Community
  • 1
  • 1
Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • Triple check on project.properties. Pretty sure the line `proguard.config=proguard-project.txt` is pointing to correct proguard configuration. I tried to change it to `proguard.config=xxx-proguard-project.txt`. As expected, I'm getting prompt error during "Export Signed Application Package..." – Cheok Yan Cheng Jan 20 '13 at 04:47