Error using PDFNet Android SDK with PowerMock


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

How can I use PDFNet with a Mocking library?


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.



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.