I am writing the following code in the HelloWorld.c
file:
#include <jni.h> JNIEXPORT jstring JNICALL Java_ru_anya_helloworldndk_HelloWorld_messageFromNativeCode (JNIEnv * env, jobject jObj) { return (*env)->NewStringUTF(env, "Hello World from c!"); }
With the help of ndk-build directly from the console, everything is collected correctly. From Eclipse with the NDK plugin on NewStringUTF
shows the error Method could not be resolved. Accordingly, the program does not start.
And what is most interesting! If you delete this error from the Problems tab, the program starts successfully, the required method is executed, there are no errors. That is, the required method is there, everything is built normally, but it shows an error. In this case, opposite the error in the code is the beetle icon.
Now I have completely turned off the error Method could not be resolved, everything works, but then if there is really no method, this situation will not catch.
How to solve this problem in a different way and what is the matter here?