1

I am reading Android Native Development Kit Cookbook. And there are sample codes in each chapter. Current chapter is dedicated to Debugging an Android NDK application with NDK GDB. But I have problems with it. The cookbook requires that AndroidManifest.xml has the android:debuggable attribute of the <application>element set to true. But when I set it true or false Eclipse complains with an error. I have read that android:debuggable=true is not mandatory, you can just do ndk-build NDK_DEBUG=1 and app will be debuggable. So I have omitted setting debuggable flag in Manifest and just build the app. Then deployed the app on device run it and called ndk-gdb from terminal. But I got this message:

$ ndk-gdb

ERROR: Package cookbook.chapter3 is not debuggable ! You can fix that in two ways:

  • Rebuilt with the NDK_DEBUG=1 option when calling 'ndk-build'.

  • Modify your manifest to set android:debuggable attribute to "true",

    then rebuild normally.

How to overcome this problems (the flag in manifest and achieve debugging)? Please help me to debug my test project. I am just learning.

Narek
  • 35,407
  • 69
  • 202
  • 359
  • If you are running Android version 4.2 or 4.3 something then it might be because of an Android bug. I had the same issue and when I tried `adb shell run-as $MY_PACKAGE_NAME` I got `Package '$MY_PACKAGE_NAME' is unknown`. Somehow I think ndk-gdb is using run-as and thats why it doesn't work. See [this](http://stackoverflow.com/questions/17219906/run-as-package-a-b-c-is-unknown-galaxy-s4-jellybean-or-android-4-3) post for more information ... – torno Jun 19 '14 at 04:29
  • See http://stackoverflow.com/q/23986724/632951 – Pacerier Nov 11 '14 at 10:51

0 Answers0