Error trying to loadLibrary for PDFTron Android
<p>I am getting a strange error when trying to integrate with PDFTron i.e PDFNet Android SDK:</p>

<blockquote>
  <p>UnsatisfiedLinkError: Couldn't load PDFNetC: findLibrary returned null. Expected armv7a, found cpu_info: abi: armeabi-v7a</p>
</blockquote>

<p>I have already checked this <a href="https://stackoverflow.com/questions/14396898/how-to-use-existing-so-file-in-android-application/14578718">link</a>.</p>

<p>Most likely the native library provided by PDFNet Android SDK is not included in my project correctly.
Inside the lib folder I the downloaded package, there are native libraries and java library that both need to be included to my project.</p>

<p>Created a folder called jniLibs in main folder and place all .so (with corresponding folder structure) inside the jniLibs folder, i.e.:</p>

<p><a href="https://i.stack.imgur.com/VCkdO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VCkdO.png" alt="enter image description here"></a></p>

<p>This will allow Android Studio to automatically recognize the native library path.</p>

<p>I also specified product flavor to filter which .so to use, such as:</p>

<pre><code>productFlavors {
    armv7a {
        ndk {
            abiFilters "armeabi-v7a"
        }
    }
    arm {
        ndk {
            abiFilters "armeabi"
        }
    }
    x86 {
        ndk {
            abiFilters "x86"
        }
    }
    armv8 {
        ndk {
            abiFilters "arm64-v8a"
        }
    }
    x86_64 {
        ndk {
            abiFilters "x86_64"
        }
    }
    fat {
        ndk {
            abiFilters "armeabi-v7a", "armeabi", "arm64-v8a", "x86", "x86_64"
        }
    }
}
</code></pre>

<p>Then I specified the jniLibs directory inside build.gradle file of your project, i.e.:</p>

<pre><code>sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        res.srcDirs = ['res']
        jniLibs.srcDirs = ['libs']
        svg.srcDir 'src/main/svg'
    }
}
</code></pre>