简体   繁体   English

无法使用本机代码调试Android应用程序

[英]Cannot debug Android application with native code

I'm trying to debug native application in Eclipse. 我正在尝试在Eclipse中调试本机应用程序。 Unfortunately, when I run "Debug As-> Android Native Application" I see the following errors in the console: 不幸的是,当我运行“ Debug As-> Android Native Application”时,在控制台中看到以下错误:

[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: 如果我尝试将“ NDK_DEBUT = 1”添加到ndk-build命令中,则会看到以下错误:

[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? 有人可以解释我在做什么错吗?

Here is a steps that may help you : 以下步骤可以为您提供帮助:

  1. Check if /home/yury/software/android-ndk/prebuilt/android-arm/gdbserver/gdbserver is exsits 检查/ home / yury / software / android-ndk / prebuilt / android-arm / gdbserver / gdbserver是否存在
  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. 下载时,请确保您的android-ndk文件夹是完整的,因为它来自Google。

Regards. 问候。

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. 像这样构建应用程序:ndk-build NDK_DEBUG:= 1 APP_OPTIM:= debug这将启用调试标志并创建调试器使用的符号文件。 You will see 2 files gdbserver.so and gdb.setup created within jni/libs folder. 您将在jni / libs文件夹中看到2个文件gdbserver.so和gdb.setup。 After this is done, you are good to debug as native application. 完成此操作后,您可以将其调试为本机应用程序。

I meet this error when I use android-ndk-r10. 使用android-ndk-r10时遇到此错误。 After I uses android-ndk-r10e, this error disappear. 使用android-ndk-r10e后,此错误消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM