java.lang.UnsatisfiedLinkError: Native method not found in Android
<p>Could someone help me locate my error, I have looked at looked I can't seem to find it, I am trying to run my code but it keeps giving me the error <code>java.lang.UnsatisfiedLinkError: Native method not found: nemo.lungu.receiptor.scanlibrary.ScanActivity.getPoints:(Landroid/graphics/Bitmap;)[F</code> below is my activity method <code>getPoints()</code>:</p>

<pre><code>   public native float[] getPoints(Bitmap bitmap); 
</code></pre>

<p>the Header version of the method <code>getPoints()</code>:</p>

<pre><code>JNIEXPORT jfloatArray JNICALL  Java_nemo_lungu_receiptor_scanlibrary_ScanActivity_getPoints
(JNIEnv *, jobject, jobject);
</code></pre>

<p>and finally the implementation of the method <code>getPoints()</code> in my <code>.cpp</code> file:</p>

<pre><code>JNIEXPORT jfloatArray JNICALL Java_nemo_lungu_receiptor_scanlibrary_ScanActivity_getPoints
(JNIEnv *env, jobject thiz,jobject bitmap)
{
__android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "Scaning getPoints");
int ret;
AndroidBitmapInfo info;
void* pixels = 0;

if ((ret = AndroidBitmap_getInfo(env, bitmap, &amp;info)) &lt; 0) {
    __android_log_print(ANDROID_LOG_VERBOSE, APPNAME,"AndroidBitmap_getInfo() failed ! error=%d", ret);
    return 0;
}

if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888 )
{       __android_log_print(ANDROID_LOG_VERBOSE, APPNAME,"Bitmap format is not RGBA_8888!");
    return 0;
}

if ((ret = AndroidBitmap_lockPixels(env, bitmap, &amp;pixels)) &lt; 0) {
    __android_log_print(ANDROID_LOG_VERBOSE, APPNAME,"AndroidBitmap_lockPixels() failed ! error=%d", ret);
}

// init our output image
Mat mbgra(info.height, info.width, CV_8UC4, pixels);
vector&lt;Point&gt; img_pts = getPoints(mbgra);

jfloatArray jArray = env-&gt;NewFloatArray(8);

if (jArray != NULL)
{
    jfloat *ptr = env-&gt;GetFloatArrayElements(jArray, NULL);

    for (int i=0,j=i+4; j&lt;8; i++,j++)
    {
        ptr[i] = img_pts[i].x;
        ptr[j] = img_pts[i].y;
    }
    env-&gt;ReleaseFloatArrayElements(jArray, ptr, NULL);
}
AndroidBitmap_unlockPixels(env, bitmap);
return jArray;
</code></pre>

<p>}</p>

<p>Am loading the library like:</p>

<pre><code>  static {

    System.loadLibrary("myLibraryName");
   }
</code></pre>

<p>Which seems to load successfully as it gives me the message <code>Added shared lib /data/app-lib/nemo.lungu.receiptor-2/myLibraryName.so 0xa4fe5e78</code> but again after that it gives me another message to say <code>No JNI_OnLoad found in /data/app-lib/nemo.lungu.receiptor-2/myLibraryName.so 0xa4fe5e78, skipping init</code> so I do not know if that is the cause or something else.</p>