Question

I have compiled mupdf library but when I integrate it in my existing android project to render the PDF it give me the following error :

java.lang.ExceptionInInitializerError

I have followed the following steps for integration :

Steps are explained here : http://pastebin.com/YzHUhzE7

When i change the package name in mupdf test project then the native code get modified and the above expiation arises . So if any one knows how to integrate MuPDF compiled in my project .

Was it helpful?

Solution

finally I have integrated compiled mupdf library into my project .

Following steps I have followed : after importing library into my project run the ndk-build on the jni. It will build the library. Now the ExpetionInitializationError is solved. Now the application is running on the device.

OTHER TIPS

You can find the answer in this link http://www.chinabtp.com/android-pdf-viewer-library-or-mupdf-library-tutorials/

Here is the instruction:

Building a MuPDF lib on windows with Cygwin and android-ndk

Download MuPDF 1.3 Source from https://code.google.com/p/mupdf/downloads/list unzip to folder c:/mupdf-1.3-source

Install Cygwin: Download and run Run setup-x86.exe from http://cygwin.com/install.html when installing cygwin, make sure you selected make packages and C++ compilers

Make generate. open cygwin terminal, run

cd /cygdrive/
cd c/mupdf-1.3-source
make generate

Install android-ndk: download android-ndk-r9d-windows-x86.zip and unzip it to

c:/android-ndk-r9d

Build mupdf lib: on windows cmd console:

    preparation:

    cd c:/mupdf-1.3-source/platform/android
    copy local.properties.sample local.properties

    edit local.properties, uncomment

    #sdk.dir=C:\\Program Files (x86)\\Android\\android-sdk

    and change to

    sdk.dir=REAL andforid-sdk Folder

    build: while still on c:/mupdf-1.3-source/platform/android, run:

    /android-ndk-r9d/ndk-build

    Upon the completion of the build, a folder named libs will be created under

    c:/mupdf-1.3-source/platform/android

Create android apk. Open eclipse, create a new android project from existing code, browse to c:/mupdf-1.3-source/platform/android, now you can create a mupdf apk.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top