Error using PDFNet Android SDK with PowerMock

51 views
Skip to first unread message

Ryan

unread,
Jan 8, 2018, 2:31:19 PM1/8/18
to PDFTron PDFNet SDK
Question:

I am trying to use PDFNet Android SDK with a Mock library called PowerMock.

However, I am getting the following error.

java.lang.ExceptionInInitializerError: Unexpected loadLibrary error. If this error persists please go to pdftron.com/kb_android_loadlibrary_error

How can I use PDFNet with a Mocking library?

Answer:

There is static initilization, and loading, of our native library, when the com.pdftron.pdf.PDFNet class is loaded, and that you need to suppress.

Try adding the following.
@SuppressStaticInitializationFor("com.pdftron.pdf.PDFNet")

Source:
See #4.

For people reading this, that are using other Mock frameworks, there should be a similar, or identical, feature that you can use to suppress the static initialization.
Reply all
Reply to author
Forward
0 new messages