Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
279 views
in Technique[技术] by (71.8m points)

android - Can not set debuggable flag in 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See official doc for SDK Tools, Revision 8 (December 2010)

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.

Update

If you really want to disable checking for debuggable flag in Eclipse you should do next:

  1. Go to the Project Preferences:
  2. Select Android Lint Preferences
  3. Find HardcodedDebugMode Id in Security section and select it
  4. Change the value of Severity to Warning for example.
  5. Apply and Ok.

Screen for details: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...