无法在 AndroidManifest.xml 中设置可调试标志
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23986724/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can not set debuggable flag in AndroidManifest.xml
提问by Narek
I try to accomplish this tutorialto learn debugging NDK apps, but when I set android:debuggable="true"
in AndroidManifest.xml file the following error occurs:
我尝试完成本教程以学习调试 NDK 应用程序,但是当我android:debuggable="true"
在 AndroidManifest.xml 文件中设置时出现以下错误:
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?
如何解决它才能调试茶壶应用程序?
回答by Igor Tyulkanov
See official doc for SDK Tools, Revision 8 (December 2010)
请参阅SDK 工具的官方文档,修订版 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.
支持真正的调试版本。开发人员不再需要将
android:debuggable
属性添加 到<application>
清单中的标签——构建工具会自动添加属性。在Eclipse/ADT 中,所有增量构建都假定为调试构建,因此工具会插入android:debuggable="true"
. 导出已签名的发布版本时,工具不会添加该属性。在 Ant 中,ant debug 命令会自动插入android:debuggable="true"
属性,而 ant release 则不会。如果android:debuggable="true"
是手动设置,那么 ant release 实际上会进行调试构建,而不是发布构建。
Update
更新
If you really want to disable checking for debuggable flag in Eclipse you should do next:
如果您真的想在 Eclipse 中禁用检查可调试标志,您应该执行以下操作:
- Go to the Project Preferences:
- Select Android Lint Preferences
- Find HardcodedDebugModeId in Securitysection and select it
- Change the value of Severityto Warningfor example.
- Applyand Ok.
- 转到项目首选项:
- 选择Android Lint 首选项
- 在Security部分找到HardcodedDebugModeId并选择它
- 例如,将严重性的值更改为警告。
- 申请并确定。
Screen for details:
屏幕详情: