Yury
Yury

Reputation: 20936

Cannot debug Android application with native code

I'm trying to debug native application in Eclipse. Unfortunately, when I run "Debug As-> Android Native Application" I see the following errors in the console:

[2014-09-10 21:03:48 - GenderDetector] Verify if the application was built with NDK_DEBUG=1
[2014-09-10 21:04:16 - GenderDetector] gdbserver output:
[2014-09-10 21:04:16 - GenderDetector] run-as: Package 'com.opencv.genderdetector' is unknown

If I try to add "NDK_DEBUT=1" to the ndk-build command I see the following errors:

[armeabi-v7a] Gdbserver      : [arm-linux-androideabi-4.9] libs/armeabi-v7a/gdbserver
install: cannot stat ‘/home/yury/software/android-ndk/prebuilt/android-arm/gdbserver/gdbserver’: No such file or directory
make: *** [libs/armeabi-v7a/gdbserver] Error 1

Could someone please explain what I'm doing wrong?

Upvotes: 0

Views: 1755

Answers (3)

qhdwangnan
qhdwangnan

Reputation: 175

I meet this error when I use android-ndk-r10. After I uses android-ndk-r10e, this error disappear.

Upvotes: 0

G3M
G3M

Reputation: 1031

Build your application like this : ndk-build NDK_DEBUG:=1 APP_OPTIM:=debug This enables the debug flag and also creates symbol files used by the debugger. You will see 2 files gdbserver.so and gdb.setup created within jni/libs folder. After this is done, you are good to debug as native application.

Upvotes: 0

Creative Coder
Creative Coder

Reputation: 418

Here is a steps that may help you :

  1. Check if /home/yury/software/android-ndk/prebuilt/android-arm/gdbserver/gdbserver is exsits
  2. Check if it has execution permission.
  3. Add this path to your environment variables this maybe will help.
  4. Make sure your android-ndk folder is complete as it comes from google when you download.

Regards.

Upvotes: 2

Related Questions