Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mupdf include native lib gradle

I am trying to include mupdf in my Android application. I run the steps from http://dixitpatel.com/integrating-pdf-in-android-application/ without any problems. But when the app is starting it runs into the following error:

Process: app.main, PID: 9712
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/app.main-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libmupdf.so"
            at java.lang.Runtime.loadLibrary(Runtime.java:366)
            at java.lang.System.loadLibrary(System.java:989)(MuPDFCore.java:14)

The "libmupdf.so" File is placed in the lib folder and I am using Android Studio with gralde.

I hope anyone can help me with that problem.

like image 897
Darthmail Avatar asked Jun 29 '15 10:06

Darthmail


1 Answers

  • Put the .so files in lib/armeabi and lib/armeabi-v7a
  • In the build.gradle add jniLibs.srcDirs = ['libs'] to the existing source sets - see How can I add .so files to an android library project using gradle 0.7+ for more details.
like image 175
JosephH Avatar answered Oct 13 '22 12:10

JosephH