I accidentally clicked on \"Add Native Support\" inside \"Android Tools\"... That messed up all the jni files of my project. How do I undo that ? How to remove Native suppo
Open up your .project
file in a text editor and just delete the entries for CDT and C nature. They are easily distinguished from those of JDT. I have done this several times and it's nothing dangerous but make a backup copy for safety.
EDIT: It might be possible also with Project Properties -> Builders -> Remove CDT Builder but never tried it.
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.
With the new ADT 20, if the project has a jni folder or/and an Android.mk file the c++ nature is added by the plugin by default,
In general to remove the C++ nature, you just need to delete the .cproject file in the project tree, remove and re-import project in the workspace and you're good to go (c++ project nature removed).
But I think you should just add the macro definitions and build imports and eclipse will work just fine. If you go to
Project properties->C/C++ general->Paths and symbols
and there you add the path to the NDK includes for the corresponding platform (something like)
{NDK_PATH}/platforms/android-9/arch-arm/usr/include
and all your build script added imports as well as any build script declared macros eclipse will handle the jni stuff just fine.
Do following steps, Hope it can help you.
After Android tools ->Add native support. It will gen cpp file on jni folder. And eclipse can not resolved it. This is a fixing way.
Step 1
Right Click PJ -> add New Folder -> In dialog add new folder, click Advanced>> check Linked Folder -> Borrow to [{NDK_PATH}/platforms/android-21/arch-arm/usr/include ] ( i used android -21, you can change it) (1)--> OK
Step 2
Right click PJ -> Properties -> C/CC general ->Paths and Symbols ->Include tab -> Add ->Work Space -> select include folder (1) in your project -> OK . Refresh and rebuild.
just remove the jni folder and clear project in c/c++ interface