title: " Cannot Resolve Corresponding JNI Function" Android Studio
body: <p>The native code
  native.c</p>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;jni.h&gt;
  
  jstring Java_com_lab5_oli_myapplication_MainActivity_helloWorld(JNIEnv* env,jobject obj)
  {
      return (*env)-&gt;NewStringUTF(env,"Hello world");
  }
  </code></pre>
  
  <p>Android.mk file</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE:=ocrex
  LOCAL_SRC_FILES:=ndkTest.c
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>Application.mk file</p>
  
  <pre><code>APP_ABI := all
  </code></pre>
  
  <p>code in MainActivity</p>
  
  <pre><code>public native String helloWorld();
  static{
      System.loadLibrary("ocrex");
  }
  </code></pre>
  
  <p>The method is recognised to be declared in the native code(note on side bar)<br>
  <a href="https://i.stack.imgur.com/Mh74U.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Mh74U.png" alt=""></a></p>