Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C JNI code introduces errors in an Android Eclipse project once the C file is opened in the editor [duplicate]

I have an Android project setup in Eclipse which uses the JNI to access C code, and everything does work fine until I open one of the C files. Once that's done I get these errors:


enter image description here


I have tried quite a bit of things, including this:

Surprise behavior of eclipse for C files while using JNI, Why so?

My NDK path is also set like so:

enter image description here

Has anyone got a solution to this? Please note that closing the project and reopening makes the problem go away but once you open a C source file the problem appears again. Also note, that the project compiles, runs and makes use of the JNI wrapper and underlying C source just fine if I do not open a C file.

EDIT:

When hovering towards the explicit red bugs I get messages like Type jstring could not be resolved. I kind of understand what the problem might be, what I don't understand is that why is this a problem only when I open the source file? And why, If i don't open the file in the editor, this works perfectly?

EDIT 2:

I forgot to mention that I am doing this on a mac.

like image 635
Arsalan Habib Avatar asked Nov 05 '13 23:11

Arsalan Habib


1 Answers

Eclipse compiles successfully but still gives semantic errors In your selected project preferences within the Eclipse environment, go to C/C++ General -> Code Analysis -> Launching. Make sure that both check boxes are unchecked.

like image 111
Louis Huang Avatar answered Oct 26 '22 23:10

Louis Huang