I'm getting this warning after gradle build
. I think it's related to my Proguard rules
and Logs
. How can I "strip invalid locals information" ?
I thought wrapping my Log's to a LogUtil class:
public class LogUtils {
public static void debug(final String tag, String message) {
if (BuildConfig.DEBUG) {
Log.d(tag, message);
}
}
}
and adding this to proguard rules
-assumenosideeffects class android.util.Log {
public static *** d(...);
}
is a good solution but I have a lot of Log.d in my project so it'll be hard.
same issue with Timber. I think it's too late to switch
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
}
ok I've fixed the issue with:
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With