I am getting a strange error when trying to integrate with PDFTron i.e PDFNet Android SDK:
UnsatisfiedLinkError: Couldn't load PDFNetC: findLibrary returned null. Expected armv7a, found cpu_info: abi: armeabi-v7a
I have already checked this link.
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.
Created a folder called jniLibs in main folder and place all .so (with corresponding folder structure) inside the jniLibs folder, i.e.:
This will allow Android Studio to automatically recognize the native library path.
I also specified product flavor to filter which .so to use, such as:
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"
}
}
}
Then I specified the jniLibs directory inside build.gradle file of your project, i.e.:
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
jniLibs.srcDirs = ['libs']
svg.srcDir 'src/main/svg'
}
}