Eclipse's NDK development environment was built almost after opening the HELLO-JNI project in the JNI samples. Add native and run without problems, but open hello-jni.c see a piece of red:
Light This document involves some of the following issues, listed to facilitate search.
Unresolved inclusion: <string.h>
Unresolved inclusion: <jni.h>
Type ' jstring ' could not being resolved
Type ' jnienv ' could not being resolved
Type ' Jobject ' could not being resolved
There may also be newstringutf unresoved problems (workaround at the bottom)
The principle is not studied, and the solution may involve one or both of the following methods depending on the situation
Method One, resolve by rebuilding. Project and. Cproject
Source: Http://stackoverflow.com/questions/23122934/eclipse-adt-unresolved-inclusion-jni-h
1. Turn off eclipse
2. Open the. project file in the Hello-jni folder with tools such as notepad++ to remove the following three pieces of content
<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. Save
4. Delete the. cproject file under the same folder
5. Re-open Eclipse
6. Right-click Project-->android tools-->add Native support ... Click Finish
If the problem is not resolved,
Method Two, add the paths to the C and C + + libraries
Right-click Items---Properties--C + + general----and Path and Symbols-includes to the right of add ... button to add the include path in the NDK path, mine is:
D:\XunLeiDownload\android-ndk-r10e\platforms\android-16\arch-arm\usr\include
Refresh project, Problem solving:
For Newstringutf's unresoved problem, finding the next, imperfect solution is Window------Preferences---------cannot be re Solved this check can be removed.
Unresolved inclusion in the Java header in JNI