title: How to add prebuilt *.so libraries in android studio?
body: <p>I am trying to integrate the <a href="https://github.com/hyperledger/indy-sdk/blob/master/docs/build-guides/android-build.md" rel="nofollow noreferrer">Hyperledger indy SDK</a>. However, when running my code I get the error</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
      java.lang.UnsatisfiedLinkError: dlopen failed: library "libgnustl_shared.so" not found
   at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
   at java.lang.System.loadLibrary(System.java:1657)
  </code></pre>
  
  <p>I am trying to follow the <a href="https://github.com/hyperledger/indy-sdk/blob/master/docs/build-guides/android-build.md" rel="nofollow noreferrer">documentation</a> provided in the project repo. I tried using the sample project on this <a href="http://ignisvulpis.blogspot.com/" rel="nofollow noreferrer">blog </a>.</p>
  
  <ul>
  <li>I was able to build the *.so libraries under a linux virtual machine, the copied the built files in my android studio project on windows.</li>
  <li>I added the files inside my project's jniLibs forlder for each architecture.</li>
  <li>Added the code to load the library inside my mainActivity</li>
  </ul>
  
  <pre><code>static{
          System.loadLibrary("indy");
      }
  </code></pre>
  
  <ul>
  <li>Tried creating a CMake file</li>
  </ul>
  
  <pre><code>cmake_minimum_required(VERSION 3.4.1)
  add_library(indy SHARED IMPORTED)
  include_directories(src/main/jniLibs/${ANDROID_ABI}/include)
  </code></pre>
  
  <p>My gradle file includes:</p>
  
  <pre><code>android{
   defaultconfig{
   ...
      ndk{
              moduleName "indy"
              abiFilters 'armeabi-v7a'
          }
   }
  ...
   sourceSets {
          main {
              jniLibs.srcDir  'src/main/jniLibs'
          }
      }
      externalNativeBuild {
          cmake {
              path file('../CMakeLists.txt')
          }
      }
  }
  </code></pre>
  
  <p>Still, keep on getting the same error when I launch the app.
  I am aware that the bash script that builds the libraries on linux uses the android-ndk-r16b-linux-x86_64 tools so I tried downgrading my ndk in android studio to use the same version but had no luck. </p>
  
  <p>The output of the build script is</p>
  
  <pre><code>include/
    indy_anoncreds.h
    indy_core.h
    ...
  lib/
    libindy.a
    libindy.so
    libindy_shared.so
  </code></pre>
  
  <p>How can I use this libraries in my android studio project?</p>