title: java.lang.UnsatisfiedLinkError: dlopen failed: libavcodec-57.so has unexpected e_machine: 40
body: <p>I'm trying to use FFmpeg 3.1.3 in the Android app.
  The 'libavcodec-57.so' is loaded in the main activity, as the following:</p>
  
  <pre><code>static {
      LogUtil.e("DEVICE ARCH", System.getProperty("os.arch"));
  
      System.loadLibrary("avutil-55");
      System.loadLibrary("avcodec-57");
  }
  </code></pre>
  
  <p>And the logcat gives me: (time is not important)</p>
  
  <pre><code>E/DEVICE ARCH: armv7l
  D/dalvikvm: Trying to load lib /data/app-lib/&lt;package_name&gt;-1/libavutil-55.so 0x4d11fe10
  D/houdini: [5955] Loading library(version: 4.1.1a_y.45536 RELEASE)... successfully.
  D/dalvikvm: Added shared lib /data/app-lib/&lt;package_name&gt;-1/libavutil-55.so 0x4d11fe10
  D/dalvikvm: No JNI_OnLoad found in /data/app-lib/&lt;package_name&gt;-1/libavutil-55.so 0x4d11fe10, skipping init
  D/dalvikvm: Trying to load lib /data/app-lib/&lt;package_name&gt;-1/libavcodec-57.so 0x4d11fe10
  D/houdini: [5955] Unsupported feature (ID:0x10600ccf).
  D/houdini: [5955] Open Native Library /data/app-lib/&lt;package_name&gt;-1/libavcodec-57.so failed.
  E/dalvikvm: Houdini dlopen("/data/app-lib/&lt;package_name&gt;-1/libavcodec-57.so") failed: Cannot load ARM library
  W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lapp/Activity/MainActivity;
  W/dalvikvm: Class init failed in newInstance call (Lapp/Activity/MainActivity;)
  D/AndroidRuntime: Shutting down VM
  W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4c810160)
  W/TDLog: UncaughtException in Thread main
      java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app-lib/&lt;package_name&gt;-1/libavcodec-57.so" has unexpected e_machine: 40
          at java.lang.Runtime.loadLibrary(Runtime.java:364)
          at java.lang.System.loadLibrary(System.java:526)
          at &lt;package_name&gt;.Activity.MainActivity.&lt;clinit&gt;(MainActivity.java:128)
          at java.lang.Class.newInstanceImpl(Native Method)
          at java.lang.Class.newInstance(Class.java:1208)
          at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2141)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2273)
          at android.app.ActivityThread.access$800(ActivityThread.java:138)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:149)
          at android.app.ActivityThread.main(ActivityThread.java:5045)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>It says that the device's arch is <strong>ARM</strong>. The <code>libavcodec-57.so</code> is failed to load and the <code>e_machine: 40</code> indicates the expected arch is also ARM (see the <a href="http://www.sco.com/developers/gabi/2000-07-17/ch4.eheader.html" rel="nofollow">ELF header doc</a>).</p>
  
  <p>Besides, both <code>libavutil-55.so</code> and <code>libavcodec-57.so</code> are located in the same directory.</p>