Couldn't load PDFNetC from loader dalvik.system.PathClassLoader

Hello,

I use PDFNet library in the application. We even bought the license to have different features that are available with paid license. However we faced a problem that can't fix. Maybe someone got the same and know the solution. So my problem is - when I do

    PDFNet.initialize(this, R.raw.pdfnet);

in the code it throws the exception

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load PDFNetC from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.skeds.android.phone.business-2.apk,libraryPath=/data/app-lib/com.skeds.android.phone.business-2]: findLibrary returned null
            at java.lang.Runtime.loadLibrary(Runtime.java:365)
            at java.lang.System.loadLibrary(System.java:535)

I googled it and the answer was to include all the libPDFNetC-..co files in the apk, which I did. But it did not help me at all. What can be the cause to this problem?

Thanks in advance.

Hi Pavel,

From your description, it seems like the problem is the app couldn’t find the correct .so library for your device.
We recommend checking the following:

  1. Were the .so libraries placed in their respective folder? (i.e. armeabi/PDFNetC.so, armeabi-v7a/PDFNetC-v7a.so, and x86/PDFNetC.so)
  2. Is this happening in a specific device? Can you reproduce the issue on emulator or other devices?
  3. Can you reproduce this in the sample app?

For more information on how to setup the project, please take a look at our getting started blog post: http://blog.pdftron.com/2013/08/09/getting-started-with-android/.
If you still have the same problem, please contact us at support@pdftron.com with detailed information on your development environment / device / application.

Best Regards,
Shirley Gong

Hi Shirley,

First of all, thanks for the reply.

.so files are placed under libs in their respective folders:

armeabi/libPDFNetC.so
armeabi-v7a/libPDFNetC-v7a.so
x86/libPDFNetC.so

It is happening on devices which I have. There are htc one x, samsung galaxy tab 2.

Will try the sample app and write you the results.

Shirley,

I looked again at the code and it was my mistake. I found out that .so files were not included as libraries in the project. Sorry for taking your time. Now everything works like a charm. Thanks for the response.