操作系统:Windows8 x64
Eclipse:ADT包形式http://developer.android.com/sdk/index.html
NDK:来自http://developer.android.com/sdk/index.html的Windows 64的NDK8e。
我将Windows / Preference / Android / NDK设置为核心NDK路径。
我的所作所为:
将%Android-NDK%/ samples中的hello-jni样例导入Eclipse
在AndroidManifext.xml中修改
<uses-sdk android:minSdkVersion="3" /> to <uses-sdkandroid:minSdkVersion="17" />
添加原生支持
右键单击项目,Android工具/添加本机支持。
打开调试
右键单击项目,Properties /“C / C ++ build”/ Build Settings,将Build命令修改为“ndk-build NDK_DEBUG = 1”
在C代码中设置断点。
Debug As / Android Native Application。
我hava用两台电脑做这件事。但是有两个错误信息。
一个就像吼叫:
[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
The Other就像吼叫:
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().
答案 0 :(得分:1)
此类消息的原因之一可能是.xml中的不规则CRLF或项目根目录中的.properties文件。