0

I am trying to learn native application development in Android and for that i created a sample application and now i am trying to debug it. I followed tutorial on this page for debugging. But now when i start debugging using this configuration i get the following error:

Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Don't know how to run.  Try "help target".
Don't know how to run.  Try "help target".

My development Environment (if needed):

  GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
  Eclipse - the eclipse ADT bundle downloaded from the android developers website
  ADT package version 23.0.1.1259578
  Eclipse CDT - Eclipse c/c++ Development Tools - 8.1.2.201302132326
  Eclipse CDT - GDB Common - 7.0.0.201302132326
  NDK - android-ndk-r10c-linux-x86_64

Any help appreciated.

Pawan
  • 1,614
  • 3
  • 18
  • 32
  • Possible duplicate of [Debug native code in Android Library](http://stackoverflow.com/questions/12638849/debug-native-code-in-android-library) and [How to debug native code in an Android library project?](http://stackoverflow.com/q/15798738/608639) – jww Dec 01 '14 at 20:10
  • Also, consider [this post](http://stackoverflow.com/questions/25159644/debug-native-application-on-samsung-4-4-2-package-is-unknown-with-run-as-comma) Some regression was introduced with respect to file permissions in Android 4.3 (patched in Android 4.4). Samsung still seems to experience problems. Make sure you are not in this situation. – Steven De Bock Dec 23 '14 at 19:44

3 Answers3

0

use debug-able permission like this:

 <application

       android:debuggable="true"
        >

I hope this will help you.

Ravind Maurya
  • 977
  • 15
  • 24
  • you can't do this because when you do this it gives a error saying: `Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one` – Pawan Nov 28 '14 at 07:19
  • Oh really. Have you find out the application tag in manifest if found then paste this line in it Otherwise leave the solution.But don't say you can't do this .Already tested solution. – Ravind Maurya Nov 28 '14 at 07:50
  • well i too tried it and i wasn't able to add it. And AFIK during development the debuggable property is set to true be default. – Pawan Nov 28 '14 at 08:04
  • the debuggable property need to be set to true manually for the ndk build options to be automatically changed. you can deactivate the specific lint check from within eclipse: http://stackoverflow.com/questions/23986724/can-not-set-debuggable-flag-in-androidmanifest-xml – ph0b Dec 05 '14 at 15:17
0

Enable debugging by this command ndk-build NDK_DEBUG=1 APP_OPTIM=debug. Hard coding is not allowed on android.mk file.

G3M
  • 1,023
  • 8
  • 19
0

I was able to debug the code by following the answer to this question. I am not posting the steps i followed because i do not want to duplicate the answer. If someone faces a problem following the answer given in the link provided, I will be more than happy to help.

Community
  • 1
  • 1
Pawan
  • 1,614
  • 3
  • 18
  • 32