On my Windows platform, I have the latest version of adt bundle (20140321) and ndk (r9d) installed. The installation is as clean as it gets. The environment variables NDK_ROOT,
after add native support,right click project, add includes in c/c++ general--> paths and symbols >> includes, for example add include as %NDK_HOME%\platforms\android-19\arch-arm\usr\include
I had the same problem some days ago. I found a fix in another question here in stackoverflow, but now I can't find the link.
In Eclipse: right-click on your project > Properties > C/C++ General > Code Analysis > Launching and disable both options ("Run with build" and "Run as you type").
There seems to be a problem with CDT and the Indexer, doing this you hide the problem. The editor will still complain but now you should be able to run and debug your application.
I solved this for adt-bundle-windows-x86_64-20140321:
.settings
.classpath
.cproject
.project
project.properties
Also this solved issue with Eclipse 4.3 previously ignored build system and user defined compiler flags. Now macros folding dependent on this flags etc works fine.
If more general - NDK plugin can properly define for you right includes and anything other required to work fine, but you need to clean your project from broken crap.
I ran into a similar problem with a working project with Android NDK-based code after updating to Eclipse Kepler. I observed similar things: the header files would correctly be listed under "includes" in the project, the actual build (via ndk-build) worked fine, but Eclipse's editor couldn't locate any headers in standard system directories (all headers with < > brackets).
I tried many different fixes, including switching toolsets, rebuilding indices etc. without success.
Finally, I removed the C nature entirely from the project, and added it back via the "Android Tools" menu in Eclipse.
Removing the C nature:
The only way I could find to reliably removed the C nature from the project was by hand editing Eclipse's .project
file for the project.
Close the Eclipse project (e.g. by quitting Eclipse).
Open the .project
file in a text or xml editor. There will be at least 2 <buildCommand>
nodes that need to be removed. Remove the <buildCommand>
node with name org.eclipse.cdt.managedbuilder.core.genmakebuilder
and all its children, and the <buildCommand>
node with name org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
and its 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 in the Project Explorer, and from the "Android Tools" contextual menu, choose "Add Native Support...".
Looking at the changes made in the .project and .cproject files before and after this change, it appears that it primarily gave new version numbers to the Android NDK tools. In any case, it solved the issue for me.