I\'ve tried searching around both on Google and on stackoverflow for an answer to this, but I\'ve been unable to find anyone with the exact issue I\'m having. I\'m attemptin
Other solution than proposed by @Albert-Jan would be to "wrap" that constant in a method. Something like
public boolean isInDeveloperMode(){
return BuildConfig.DEBUG;
}
in which case it will not be "resolved" as constant by gradle and there will be no problem during build time.
Probably the most famous "exploit" of this approach would be isUserAGoat() method from UserManager class in Android SDK. There is very popular discussion here about possible uses of this method.. Enjoy ;)
Hopefully this will be useful for somebody with similar issues