2

I was using the MuPDF to create a PDF Reader Application. So I download MuPDF source and build the demo app of it.

I followed the guide in this link http://mupdf.com/docs/how-to-build-mupdf-for-android and build everything needed.

Then I import the demo app project into my Android Studio 0.4, build the apk and install it on my Galaxy Nexus with Android 4.3, when I open a PDF file with the demo app, it said "Cannot open document"

In the Logcat is

01-28 15:24:08.760      375-655/? I/ActivityManager﹕ START u0 {act=android.intent.action.VIEW dat=/storage/emulated/0/Download/abc.pdf cmp=com.artifex.mupdfdemo/.MuPDFActivity} from pid 22098
01-28 15:24:08.784  22098-22098/? I/System.out﹕ Trying to open /storage/emulated/0/Download/abc.pdf
01-28 15:24:08.784  22098-22098/? D/dalvikvm﹕ Trying to load lib /data/app-lib/com.artifex.mupdfdemo-1/libmupdf.so 0x41fce240
01-28 15:24:08.792  22098-22098/? D/dalvikvm﹕ Added shared lib /data/app-lib/com.artifex.mupdfdemo-1/libmupdf.so 0x41fce240
01-28 15:24:08.792  22098-22098/? D/dalvikvm﹕ No JNI_OnLoad found in /data/app-lib/com.artifex.mupdfdemo-1/libmupdf.so 0x41fce240, skipping init
01-28 15:24:08.792  22098-22098/? E/libmupdf﹕ Opening document...
01-28 15:24:08.792  22098-22098/? E/libmupdf﹕ error: No document handlers registered
01-28 15:24:08.792  22098-22098/? E/libmupdf﹕ error: Cannot open document: '/storage/emulated/0/Download/abc.pdf'
01-28 15:24:08.792  22098-22098/? E/libmupdf﹕ Failed: Cannot open document: '/storage/emulated/0/Download/abc.pdf'
01-28 15:24:08.799  22098-22098/? I/System.out﹕ java.lang.Exception: Cannot open document:/storage/emulated/0/Download/abc.pdf

I download the mupdf app from Google Play, extract the libmupdf.so file from the apk and put the .so file to the mupdf/platform/android/libs/armeabi-v7a/ then package the apk file in the Android Studio and install it, it works.

So I am wondering why this happen. It seems that there must be something wrong when I complile the mupdf.

Does someone else have met this kind of problem? Please tell me how do you solve it.

Thanks a lot!

rock_cloud
  • 123
  • 1
  • 1
  • 7
  • are you sure that you build your libmupdf.so successfully? – x90 Jan 28 '14 at 07:56
  • Yeah, I'm sure. The last three line of the ndk-build out put is [armeabi-v7a] StaticLibrary : libmupdfthirdparty.a [armeabi-v7a] SharedLibrary : libmupdf.so [armeabi-v7a] Install : libmupdf.so => libs/armeabi-v7a/libmupdf.so and I can see a libmupdf.so at mupdf/platform/android/libs/armeabi-v7a/ – rock_cloud Jan 28 '14 at 11:50
  • http://stackoverflow.com/a/13395875/799799 please check this answer and try it. – x90 Jan 28 '14 at 14:25

0 Answers0