ndk-gdb on windows

2020-07-26 15:13发布

问题:

i m trying to debug my jni section of application by running ngk-gdb on windows machine with android-ndk-r8b. i am using cygwin and c/c++ plugin for eclipse.my device is galaxy s, android 2.3.7

what i did is followed the instructions on Using Eclipse for Android C/C++ Debugging, but i am stuck on running ndk-gdb, getting this error:

Device CPU ABIs: armeabi-v7a armeabi
ERROR: The device does not support the application's targetted CPU ABIs!
       Device supports:  armeabi-v7a armeabi
       Package supports:

thx for your help

回答1:

I encountered the problem recently and in my case it was a cygwin issue. make was not installed in cygwin and this created problems further along in the ndk-gdb script. After installing make using the cygwin setup.exe (select make under Devel - on another recommendation, I also installed tcsh under Shells), the "ABIS targetted by application:" line shows the app's targeted ABI.

Without make:

/cygdrive/c/work/android/android-ndk-r8b-windows/android-ndk-r8b/ndk-gdb: line 105: make: command not found  
ABIs targetted by application:  
Device API Level: 15  
Device CPU ABIs: armeabi-v7a armeabi  
ERROR: The device does not support the application's targetted CPU ABIs!  
       Device supports:  armeabi-v7a armeabi  
       Package supports:  

With make properly installed:

ABIs targetted by application: armeabi-v7a  
Device API Level: 15  
Device CPU ABIs: armeabi-v7a armeabi  
Compatible device ABI: armeabi-v7a  

Application.mk, located in the jni folder, can be used to specify the app's targeted ABI - an example:

APP_ABI := armeabi-v7a
APP_OPTIM := debug

Good luck!



回答2:

For all others like me with Nexus (devices) updated with Android 4.3 there are bugs that hinder Native code debugging. (I tried everything found on SO :)

  1. Either root your device and try
  2. Or Update nexus 4.3 factory image here (and this is reported working by google android dev)
  3. Or wait for Android 4.4 update to come to your device (as bug is identified and fix in the source tree by Google by not yet packaged released)