My project doesn't seem to be aware of this new constant that's apparently auto-generated in Android Tools r17 builds:
"Added a feature that allows you to run some code only in debug mode. Builds now generate a class called BuildConfig containing a DEBUG constant that is automatically set according to your build type. You can check the (BuildConfig.DEBUG) constant in your code to run debug-only functions such as outputting debug logs."
I've confirmed that this class is not being auto-generated anywhere in my project by the new tools. I deleted all project outputs (including all gen folders) and rebuilt, and only R.java classes are being generated.
Why are the tools not generating the BuildConfig class? It may be relevant that I'm using IntelliJ.
BuildConfig is a class containing static constants that is included in every Android application. BuildConfig includes some default fields such as DEBUG and FLAVOR but you can also add custom values via build.
What is BuildConfig? Gradle generates a BuildConfig class that contains static configuration constants that are specific to the build at build time. The class includes default fields such as debug and flavor, but you can override them with build.
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.
IntelliJ doesn't generate the BuildConfig java and class files.
I assume this function is provided by the ADT plugin for Eclipse, and isn't a part of the SDK tools/common build stuff.
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