android - 无法在 AndroidManifest.xml 中设置可调试标志

标签 android android-ndk android-manifest

我尝试完成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 insert android:debuggable="true". When exporting a signed release build, the tools do not add the attribute. In Ant, a ant debug command automatically inserts the android:debuggable="true" attribute, while ant release does not. If android:debuggable="true" is manually set, then ant release will actually do a debug build, rather than a release build.

更新

如果您真的想在 Eclipse 中禁用检查可调试标志,您应该执行以下操作:

  1. 转到项目首选项:
  2. 选择 Android Lint 首选项
  3. Security 部分找到 HardcodedDebugMode Id 并选择它
  4. 例如将 Severity 的值更改为 Warning
  5. 应用确定

屏幕详情: enter image description here

关于android - 无法在 AndroidManifest.xml 中设置可调试标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23986724/

相关文章:

android - Android OpenCV 端口有什么缺点吗?

android - 测试特定的 androidmanifest 文件属性和额外的 Activity

android - 如何检查移动数据是否实际处于 Activity 状态或 wifi 是否实际连接到任何热点?

java - 无法找到显式 Activity 类 {};你有没有在你的 AndroidManifest.xml 中声明这个 Activity

Android Architecture Components LiveData进度更新

android - 如何使用 AppBarConfiguration 设置 NavigationView?

Android NDK 位置不可配置

android - Superpowered API - SuperpoweredDecoder::decode 不为文件末尾返回 0

java - 在 listView 中 onClick 之后创建一个对话框

java - list 合并失败并出现多个错误,请参阅 Android Studio 上的日志