Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripped invalid locals information from 1 method - Proguard

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());
}
like image 569
Ege Kuzubasioglu Avatar asked Feb 26 '18 12:02

Ege Kuzubasioglu


1 Answers

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(...);
}
like image 134
Ege Kuzubasioglu Avatar answered Oct 22 '22 02:10

Ege Kuzubasioglu