title: java.lang.UnsatisfiedLinkError: dlopen failed:
body: <p>I am facing the issue while I am adding the .so file in my project, from the other ans, I have tried with different solutions but not any solution help me out.</p>
  
  <p><strong>case: 1</strong> I had tried to put my .so in src/main/jniLibs and in the gradle file I had added below lines, but getting the same error. </p>
  
  <pre><code> android {
       sourceSets.main.jni.srcDirs = []
  }
  </code></pre>
  
  <p><strong>case:2</strong> I had added cpp folder with native-lib.cpp and in gradle added below code:</p>
  
  <pre><code>defaultConfig {
   ndk {
          abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
    }
     }
  </code></pre>
  
  <p><strong>case:3</strong> I had created new fresh project with c/c++ support and add a .so file under cpp folder and in the gradle added below code:</p>
  
  <pre><code>defaultConfig {
    externalNativeBuild {
          cmake {
              cppFlags "-std=c++11"
  
          }
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SLkn9.png" rel="nofollow noreferrer">My project architecture</a></p>
  
  <p><strong>error code:</strong></p>
  
  <pre><code>FATAL EXCEPTION: main
  Process: ai.kitt.snowboy.demo, PID: 15175
  java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/ai.kitt.snowboy.demo-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libsnowboy-detect-android.so" 
   at java.lang.Runtime.loadLibrary(Runtime.java:366)
   at java.lang.System.loadLibrary(System.java:988)
   at ai.kitt.snowboy.audio.RecordingThread.&lt;clinit&gt;(RecordingThread.java:20)
   at ai.kitt.snowboy.Demo.onCreate(Demo.java:49)
   at android.app.Activity.performCreate(Activity.java:6010)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
   at android.app.ActivityThread.access$800(ActivityThread.java:155)  
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:135)
   at android.app.ActivityThread.main(ActivityThread.java:5343)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
  </code></pre>
  
  <p>I am using android studio 3.0.1, gradle: 3.0.1</p>