BuildConfig.DEBUG always return false

cocoa picture cocoa · Apr 1, 2016 · Viewed 11.3k times · Source

Why does BuildConfig.DEBUG return false, when I run the application?

I use it to control the log like the following:

public static void d(String LOG_TAG, String msg){
    if(BuildConfig.DEBUG){
        Log.d(LOG_TAG,msg);
    }
}

Answer

DmitryBorodin picture DmitryBorodin · Apr 3, 2017

Check imports in the class, make sure you are using correct BuildConfig path. You may use BuildConfig not from your app, but from some library.