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); } }
In recent versions of the Android Developer Tools (ADT) for Eclipse, there's a class called BuildConfig which is automatically generated by the build. This class is updated automatically by Android's build system (like the R class), and it contains a static final boolean called DEBUG, which is normally set to true.
There's a class called BuildConfig. java which is automatically generated by the build system. This class is updated automatically by Android's build system (like the R class). It already contains a static final boolean called DEBUG, which is normally set to true.
BuildConfig. java is generated automatically by Android build tools, and is placed into the gen folder.
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.
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