ExceptionWithContext gets thrown when trying to build an Android app with Ant

前端 未结 3 575
我在风中等你
我在风中等你 2020-12-15 04:39

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

3条回答
  •  一生所求
    2020-12-15 05:11

    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

提交回复
热议问题