1.错误:
Unresolved inclusion: <jni.h>、Type 'jint' could not be resolved、Type 'jintArray' could not be resolved
2.原因 头文件未引入
3.解决
选择工程->propority->c/c++ General->Path and Symbols->includes->add:
1)/home/wangbin/software/tools/NDK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.8/include
2)/home/wangbin/software/tools/NDK/android-ndk-r10e/platforms/android-17/arch-arm/usr/include
参考:http://www.tuicool.com/articles/aM7f6b
http://stackoverflow.com/questions/16284199/android-ndk-in-eclipse-type-size-t-could-not-be-resolved
续:
将运行OK ndk工程导入eclipse时又发生该错误,但上述方法以及实施。
进一步解决方案:
1. 在eclipse中关闭指定Project
2. 用其他编辑工具打开该project的.project文件,删除以下内容:
......
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
......
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
......
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
3. 删除.cproject文件
4. 在eclipse里打开原来的project, refresh,然后右键->properties->Android Tools -> Add Native Support