title: specify .so files in build.gradle file android studio
body: <p>This is my Directory Structure</p>
  
  <pre><code>src -main
  
      -java
  
      -jniLibs
  
              -armeabi
  
                       -lib1.so
                       -lib2.so
  </code></pre>
  
  <p><strong><em>Need to understand what piece of code should be written in build gradle file for these files to be included in the build.
  Right now, i am getting the error of not finding the .so file.</em></strong></p>
  
  <pre><code>  java.lang.UnsatisfiedLinkError: nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libFPEComponent.so"
  </code></pre>
  
  <p>Following <a href="https://stackoverflow.com/a/44932104/4075178">solution by H.Brooks</a></p>
  
  <p>I have got to add here </p>
  
  <p><a href="https://i.stack.imgur.com/obgcJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/obgcJ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://github.com/vikas0/BiometricRecordSample" rel="nofollow noreferrer">My Git repository:</a></p>
  
  <p>My bUild.gradle file</p>
  
  <pre><code> apply plugin: 'com.android.application'
  
  android {
      productFlavors {
          arm {
              ndk {
                  abiFilters "armeabi-v7a", "armeabi"
              }
          }
  
      }
  
      sourceSets
              {
                  main
                          {
  
                              jniLibs.srcDirs = ['src/main/jnilibs']
  
                          }
  
  //Another code
  
              }
  
      compileSdkVersion 26
      buildToolsVersion '26.0.0'
      defaultConfig {
          applicationId "com.goambee.biometricziqitza"
          minSdkVersion 15
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
  
      }
      splits {
  
          // Configures multiple APKs based on ABI.
          abi {
  
              // Enables building multiple APKs per ABI.
              enable true
  
              // By default all ABIs are included, so use reset() and include to specify that we only
              // want APKs for x86, armeabi-v7a, and mips.
  
              // Resets the list of ABIs that Gradle should create APKs for to none.
              reset()
  
              // Specifies a list of ABIs that Gradle should create APKs for.
              include "armeabi-v7a"
  
              // Specifies that we do not want to also generate a universal APK that includes all ABIs.
              universalApk false
          }
      }
  }
  
  dependencies {
  
      compile fileTree(include: ['*.jar'], dir: 'libs')
  //    compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
  
  
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
      compile 'com.android.support.constraint:constraint-layout:1.0.2'
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
  }
  
  //task native-libstiveLibsToJar(type: Jar, description: 'create a jar archive of the native libs') {
  //    destinationDir file("$buildDir/native-libs")
  //    baseName 'native-libs'
  //    from fileTree(dir: 'src/main/jnilibs', include: '**/*.so')
  //    into 'lib/'
  //}
  //
  //tasks.withType(JavaCompile)
  //        {
  //            compileTask -&gt; compileTask.dependsOn(nativeLibsToJar)
  //        }
  </code></pre>
  
  <p><strong>Here i have included source set block, i also had tested without that block.</strong>
  <strong>So still build isn't able to access .so files.</strong></p>