title: No implementation found for native, java.lang.UnsatisfiedLinkError
body: <p>Okay before you flag this as a duplicate I have tried the following</p>
  
  <p><a href="https://stackoverflow.com/questions/6096355/no-implementation-found-for-native">No implementation found for native</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12968366/no-implementation-found-for-native-stitch">No implementation found for native Stitch</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15386204/no-implementation-found-for-native-in-ndk">No Implementation found for native in ndk</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14285651/no-implementation-found-for-native-lcom-jp-algi">No implementation found for native Lcom/jp/algi/</a></p>
  
  <p><a href="https://stackoverflow.com/questions/2197889/android-ndk-c-jni-no-implementation-found-for-native">Android NDK C++ JNI (no implementation found for native...)</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14978197/android-ndk-no-implementation-found-for-native-xxxxxx">Android NDK: No implementation found for native xxxxxx</a></p>
  
  <p>here is my MainActivity.java</p>
  
  <p>public class MainActivity extends Activity {</p>
  
  <pre><code>static {
      System.loadLibrary("physfs");
      System.loadLibrary("jpeg");
      System.loadLibrary("tiff");
      System.loadLibrary("mng");
      System.loadLibrary("png");
      System.loadLibrary("jasper");
      System.loadLibrary("lcms");
      System.loadLibrary("devil");
      System.loadLibrary("mylib");
      }
  
  public static native void convert();
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      convert();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>the c file</p>
  
  <pre><code>#include "com_myproject_MainActivity.h"
  #include &lt;string.h&gt;
  #include &lt;jni.h&gt;
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  JNIEXPORT void JNICALL Java_com_myproject_MainActivity_convert
    (JNIEnv *, jclass){
  .....
  }
  </code></pre>
  
  <p>the javah generated header snippet</p>
  
  <pre><code>#define com_myproject_MainActivity_DEFAULT_KEYS_SHORTCUT 2L
  #undef com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_LOCAL
  #define com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_LOCAL 3L
  #undef com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_GLOBAL
  #define com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_GLOBAL 4L
  /*
   * Class:     com_myproject_MainActivity
   * Method:    convert
   * Signature: ()V
   */
  JNIEXPORT void JNICALL Java_com_myproject_MainActivity_convert
    (JNIEnv *, jclass);
  
  #ifdef __cplusplus
  }
  #endif
  #endif
  </code></pre>
  
  <p>the portion of the android.mk file that sources the C file</p>
  
  <pre><code>#mylib
  include $(CLEAR_VARS)
  LOCAL_MODULE    := libmylib
  LOCAL_CFLAGS    := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT
  LOCAL_CPPFLAGS  := ${LOCAL_CFLAGS}
  LOCAL_C_INCLUDES  :=  \
      ${DEVIL_SRC_PATH}include \
      ${DEVIL_SRC_PATH}src-IL/include \
      ${JASPER_SRC_PATH}src/libjasper/include \
      ${PNG_SRC_PATH} \
      ${MNG_SRC_PATH} \
      ${JPEG_SRC_PATH} \
      ${LCMS_SRC_PATH}include/ \
      ${TIFF_SRC_PATH}libtiff/ \
  LOCAL_SRC_FILES := com_myproject_MainActivity.c
  
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>I have tried the C file as .cpp and used extern "C" in all possible ways no result.
  I have also deleted the bin,out,libs and obj folders several times and freshly built.
  The code compiles and .so files are made.</p>
  
  <p>But I can't run it this is the log</p>
  
  <pre><code>&gt; 08-02 01:59:07.268: E/Trace(1569): error opening trace file: No such
      &gt; file or directory (2) 08-02 01:59:07.268: D/dalvikvm(1569): Trying to
      &gt; load lib /data/data/com.myproject/lib/libphysfs.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libphysfs.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libphysfs.so 0xb63c3518, skipping init
      &gt; 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/libjpeg.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libjpeg.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libjpeg.so 0xb63c3518, skipping init
      &gt; 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/libtiff.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libtiff.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libtiff.so 0xb63c3518, skipping init
      &gt; 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/libmng.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libmng.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libmng.so 0xb63c3518, skipping init 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/libpng.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libpng.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libpng.so 0xb63c3518, skipping init 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/libjasper.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libjasper.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libjasper.so 0xb63c3518, skipping init
      &gt; 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/liblcms.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/liblcms.so 0xb63c3518 08-02 01:59:07.268:
      &gt; D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/liblcms.so 0xb63c3518, skipping init
      &gt; 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/libdevil.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libdevil.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libdevil.so 0xb63c3518, skipping init
      &gt; 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
      &gt; /data/data/com.myproject/lib/libmylib.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): Added shared lib
      &gt; /data/data/com.myproject/lib/libmylib.so 0xb63c3518 08-02
      &gt; 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
      &gt; /data/data/com.myproject/lib/libmylib.so 0xb63c3518, skipping init
      &gt; 08-02 01:59:07.288: W/dalvikvm(1569): No implementation found for
      &gt; native Lcom/myproject/MainActivity;.convert:()V 08-02 01:59:07.288:
      &gt; D/AndroidRuntime(1569): Shutting down VM 08-02 01:59:07.288:
      &gt; W/dalvikvm(1569): threadid=1: thread exiting with uncaught exception
      &gt; (group=0xb5e5e288) 08-02 01:59:07.288: E/AndroidRuntime(1569): FATAL
      &gt; EXCEPTION: main 08-02 01:59:07.288: E/AndroidRuntime(1569):
      &gt; java.lang.UnsatisfiedLinkError: Native method not found:
      &gt; com.myproject.MainActivity.convert:()V 08-02 01:59:07.288:
      &gt; E/AndroidRuntime(1569):   at com.myproject.MainActivity.convert(Native
      &gt; Method) 08-02 01:59:07.288: E/AndroidRuntime(1569):   at
      &gt; com.myproject.MainActivity.onCreate(MainActivity.java:30) 08-02
      &gt; 01:59:07.288: E/AndroidRuntime(1569):     at
      &gt; android.app.Activity.performCreate(Activity.java:5008) 08-02
      &gt; 01:59:07.288: E/AndroidRuntime(1569):     at
      &gt; android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
      &gt; 08-02 01:59:07.288: E/AndroidRuntime(1569):   at
      &gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
      &gt; 08-02 01:59:07.288: E/AndroidRuntime(1569):   at
      &gt; android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
      &gt; 08-02 01:59:07.288: E/AndroidRuntime(1569):   at
      &gt; android.app.ActivityThread.access$600(ActivityThread.java:130) 08-02
      &gt; 01:59:07.288: E/AndroidRuntime(1569):     at
      &gt; android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
      &gt; 08-02 01:59:07.288: E/AndroidRuntime(1569):   at
      &gt; android.os.Handler.dispatchMessage(Handler.java:99) 08-02
      &gt; 01:59:07.288: E/AndroidRuntime(1569):     at
      &gt; android.os.Looper.loop(Looper.java:137) 08-02 01:59:07.288:
      &gt; E/AndroidRuntime(1569):   at
      &gt; android.app.ActivityThread.main(ActivityThread.java:4745) 08-02
      &gt; 01:59:07.288: E/AndroidRuntime(1569):     at
      &gt; java.lang.reflect.Method.invokeNative(Native Method) 08-02
      &gt; 01:59:07.288: E/AndroidRuntime(1569):     at
      &gt; java.lang.reflect.Method.invoke(Method.java:511) 08-02 01:59:07.288:
      &gt; E/AndroidRuntime(1569):   at
      &gt; com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
      &gt; 08-02 01:59:07.288: E/AndroidRuntime(1569):   at
      &gt; com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 08-02
      &gt; 01:59:07.288: E/AndroidRuntime(1569):     at
      &gt; dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>For some reason the method isn't being seen and yet the library is loading....
  for what it's worth, I edited this code from <a href="https://github.com/hagish/love-native-android" rel="nofollow noreferrer">here</a> and pulled out what i needed.
  Thanx</p>