无法在 AndroidManifest.xml 中设置可调试标志 [英] Can not set debuggable flag in AndroidManifest.xml
问题描述
我尝试完成本教程来学习调试 NDK 应用程序,但是当我设置 android:debuggable="true"
在 AndroidManifest.xml 文件中出现以下错误:
I try to accomplish this tutorial to learn debugging NDK apps, but when I set android:debuggable="true"
in AndroidManifest.xml file the following error occurs:
避免硬编码调试模式;省略它允许调试和发布构建以自动分配一个
Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one
如何解决才能调试茶壶应用程序?
How to solve it to be able to debug Teapot app?
推荐答案
查看官方文档 SDK 工具,修订版 8(2010 年 12 月)
See official doc for SDK Tools, Revision 8 (December 2010)
支持真正的调试版本.开发人员不再需要添加android:debuggable
属性到清单中的
标签— 构建工具自动添加属性.在 Eclipse/ADT 中,所有增量构建被假定为调试构建,因此工具插入android:debuggable="true"
.导出已签名的发布版本时,工具不添加属性.在 Ant 中,一个 ant 调试命令自动插入 android:debuggable="true"
属性,而蚂蚁释放没有.如果 android:debuggable="true"
手动设置,然后 ant release 实际上会进行调试构建,而不是发布构建.
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 中禁用可调试标志的检查,你应该做下一步:
If you really want to disable checking for debuggable flag in Eclipse you should do next:
- 转到项目首选项:
- 选择 Android Lint 首选项
- 在 Security 部分中找到 HardcodedDebugMode Id 并选择它
- 例如将严重性的值更改为警告.
- 申请并确定.
- Go to the Project Preferences:
- Select Android Lint Preferences
- Find HardcodedDebugMode Id in Security section and select it
- Change the value of Severity to Warning for example.
- Apply and Ok.
详细信息屏幕:
这篇关于无法在 AndroidManifest.xml 中设置可调试标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!