Sometimes, you download or copy the JNI project there is a inexplicable error, usually not find the head file, the possible solution is as follows:
removing the C nature:
The only-I could find to reliably removed the C nature from the project is by hand editing Eclipse's .project file for T He project.
Close the Eclipse project (e.g. by quitting Eclipse).
Open the .project file in a text or XML editor. There'll is at least 2 <buildCommand> nodes that need to be removed. The Remove <buildCommand> org.eclipse.cdt.managedbuilder.core.genmakebuilder the node with name and all it children, and the node with name and its <buildCommand> org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder children. Finally, remove the lines:
<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>
Completely Remove the .cproject file.
Adding back the Android Native nature
Reopen the project in Eclipse. Then right-click on the project Explorer, and from the "Android Tools" contextual menu, choose "Add Native Support ... ".
Reference:Http://stackoverflow.com/questions/23122934/eclipse-adt-unresolved-inclusion-jni-hAndroid JNI Project Tip "Unresolved inclusion: <jni.h>" possible other solutions:
- Paths and symbols path is not correct, consider modifying the contents of android.mk file, such as adding blank lines (note that the Android file does not require a local_c_includes field, the system will be based on LOCAL_SRC_ Files automatically add the required header files, otherwise the header file will appear ambiguity), re-compile the project, the Android.mk file local_src_files will depend on the header file in the project Properties Paths and symbols are automatically added;
- String.h, jni.h and other C-header file "unresolved inclusion", consider: NDK Project--New--------Link to alternate Lo cation (Linked Folder), added: D:\ADT\android-ndk-r9d\platforms\android-18\arch-arm\usr\include;
- Consideration: Properties--->c/c++ general, turn off the code analysis function and resolve most errors;
Using the NDK to compile common solutions for Android projects with JNI