我尝试完成this tutorial学习调试 NDK 应用程序,但是当我在 AndroidManifest.xml 文件中设置 android:debuggable="true"
时出现以下错误:
Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one
如何解决才能调试茶壶app?
最佳答案
查看官方文档 SDK Tools , 修订版 8(2010 年 12 月)
Support for a true debug build. Developers no longer need to add the
android:debuggable
attribute to the<application>
tag in the manifest — the build tools add the attribute automatically. In Eclipse/ADT, all incremental builds are assumed to be debug builds, so the tools insertandroid:debuggable="true"
. When exporting a signed release build, the tools do not add the attribute. In Ant, a ant debug command automatically inserts theandroid:debuggable="true"
attribute, while ant release does not. Ifandroid:debuggable="true"
is manually set, then ant release will actually do a debug build, rather than a release build.
更新
如果您真的想在 Eclipse 中禁用检查可调试标志,您应该执行以下操作:
- 转到项目首选项:
- 选择 Android Lint 首选项
- 在 Security 部分找到 HardcodedDebugMode Id 并选择它
- 例如将 Severity 的值更改为 Warning。
- 应用和确定。
屏幕详情:
关于android - 无法在 AndroidManifest.xml 中设置可调试标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23986724/