Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ndk-gdb fails with message: Invalid attribute name: package

Connect Nexus One to Mac running Snow Leopard. Run "debug" from Eclipse. Shows the execution of

/usr/local/android-ndk-r5b/ndk-build NDK_DEBUG=1 

Loads on Nexus One fine. Then I try to run the debugger so I can get to the JNI layer:

$ $NDK_DIR/ndk-gdb 

Fails with these msgs:

Invalid attribute name: 
          package
Invalid attribute name: 
          package
Invalid attribute name: 
          package
ERROR: Non-debuggable application installed on the target device.
       Please re-install the debuggable version!

So I checked the apk in bin and it has

lib/armeabi/gdbserver

Looked at the ndk-dbg script, and this message means it's failing trying to find gdbserver on the phone. So I tried to do some ls commands by hand :

$ adb shell ls /data
opendir failed, Permission denied

So I looked at /data and the permissions are 771.

What have I done wrong to get to this point?

like image 384
Scott C Wilson Avatar asked Apr 15 '11 13:04

Scott C Wilson


1 Answers

The AndroidManifest.xml file had Windows carriage control (\r\n) which was messing up the ndk-gdb script. To fix this, I edited the file in vi and did a "set filetype=unix".

like image 192
Scott C Wilson Avatar answered Oct 24 '22 11:10

Scott C Wilson