How to remove native support from an Android Project in eclipse because eclipse is showing errors in jni?

前端 未结 5 2098
暖寄归人
暖寄归人 2020-12-14 07:12

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

5条回答
  •  天命终不由人
    2020-12-14 08:02

    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.

提交回复
热议问题