NDK 调试问题
环境:体统:Windows8 x64
Eclipse: ADT Bundle(http://developer.android.com/sdk/index.html)
NDK: NDK8e for Windows 64(http://developer.android.com/sdk/index.html)
配置:
使用ADT Bundle自带的Android SDK,设置NDK路径。
测试:
- 从%Android-NDK%/samples目录下导入hello-jni到Eclipse工程
- 修改AndroidManifext.xml文件
把<uses-sdk android:minSdkVersion="3" />修改为<uses-sdk android:minSdkVersion="17" />
- Add Native Support
右键工程,Android Tools/Add Native Support
- 打开NDK的Debug开关
右键工程, Properties/"C/C++ build"/Build Settings,修改“Build command”为"ndk-build NDK_DEBUG=1"
- 在C代码中打断点
- Debug As/Android Native Application
结果:
我在两台相同平台的电脑上做了实验,得到不同的错误结果:
其中一台的错误信息为:
[2013-06-12 00:03:09 - HelloJni] Unknown Application ABI:
[2013-06-12 00:03:09 - HelloJni] [2013-06-12 00:03:09 - HelloJni] Unable to detect application ABI's
另外一台的错误信息为:
warning: Could not load shared library symbols for 73 libraries, e.g. /system/binnker.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Unable to find dynamic linker breakpoint function.
GDB will retry eventurally. Meanwhile, it is likely
that GDB is unable to debug shared library initializers
or resolve pending breakpoints after dlopen().
android ndk debug --------------------编程问答-------------------- Do you need "set solib-search-path" or "set sysroot" 解决了没? --------------------编程问答-------------------- 还没有,解决这个错误是否要装Cygwin? --------------------编程问答-------------------- 没安装Cygwin,那你有C++的编译环境吗 --------------------编程问答-------------------- 说错了,是GCC --------------------编程问答-------------------- NDK8e编译不需要安装Cygwin,ndk-build可以直接将C/C++编译成so。Debug As/Android的时候,自动编译并生成so。 --------------------编程问答-------------------- ;linux同样这个问题,无解 --------------------编程问答-------------------- AndroidManifest.xml中的minSdkVerison还不支持定义的android api的版本
补充:移动开发 , Android