BuildConfig.DEBUG在哪里? [英] Where is BuildConfig.DEBUG?

查看:164
本文介绍了BuildConfig.DEBUG在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目似乎没有意识到这个显然是在Android Tools r17版本中自动生成的新常量:

My project doesn't seem to be aware of this new constant that's apparently auto-generated in Android Tools r17 builds:

"添加了一项功能,该功能仅允许您在调试模式下运行某些代码.现在,构建会生成一个名为BuildConfig的类,其中包含一个DEBUG常数,该常数会根据您的构建类型自动设置.您可以检查(BuildConfig.DEBUG)常数在您的代码中运行仅调试功能,例如输出调试日志."

"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."

我已经确认,新工具不会在我的项目中的任何地方自动生成此类.我删除了所有项目输出(包括所有gen文件夹)并进行了重建,并且仅生成了R.java类.

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.

为什么这些工具不能生成BuildConfig类?我正在使用IntelliJ可能与之有关.

Why are the tools not generating the BuildConfig class? It may be relevant that I'm using IntelliJ.

推荐答案

IntelliJ不会生成BuildConfig Java和类文件.

IntelliJ doesn't generate the BuildConfig java and class files.

我认为此功能是由Eclipse的ADT插件提供的,并且不是SDK工具/通用构建工具的一部分.

I assume this function is provided by the ADT plugin for Eclipse, and isn't a part of the SDK tools/common build stuff.

这篇关于BuildConfig.DEBUG在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆