1

I am running the pdftron Complete Reader example,but not able to run the project. I have assemble the project using http://blog.pdftron.com/2013/08/09/getting-started-with-android/#toolslib

It is giving error at this line--

// Initialize thumbnail cache for the recent list.
try {
    RecentlyUsedCache.initializeRecentlyUsedCache(RecentFilesManager.MAX_NUM_RECENT_FILES, 10 * 1024 * 1024, 0.1);
} catch (PDFNetException e) {
}

Error

06-12 18:00:14.703: E/AndroidRuntime(2842): FATAL EXCEPTION: main
06-12 18:00:14.703: E/AndroidRuntime(2842): java.lang.UnsatisfiedLinkError: Native method not found: pdftron.Common.RecentlyUsedCache.InitializeRecentlyUsedCache:(JJD)V
06-12 18:00:14.703: E/AndroidRuntime(2842):     at pdftron.Common.RecentlyUsedCache.InitializeRecentlyUsedCache(Native Method)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at pdftron.Common.RecentlyUsedCache.initializeRecentlyUsedCache(SourceFile:89)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at com.pdftron.pdfnet.demo.completereader.viewer.CompleteReaderMainActivity.onCreate(CompleteReaderMainActivity.java:105)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.app.Activity.performCreate(Activity.java:5185)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2071)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2132)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.app.ActivityThread.access$700(ActivityThread.java:140)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.os.Looper.loop(Looper.java:137)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at android.app.ActivityThread.main(ActivityThread.java:4918)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at java.lang.reflect.Method.invokeNative(Native Method)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at java.lang.reflect.Method.invoke(Method.java:511)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
06-12 18:00:14.703: E/AndroidRuntime(2842):     at dalvik.system.NativeStart.main(Native Method)

Thanks in advance.

Prateek
  • 306
  • 4
  • 17
  • 1
    Looks like either you're missing the .so file from pdftron, the .so file you're using doesn't have the function (different versions), or the signature you're using is wrong. If you have the .so file, I'd double check you're passing the right parameters and that they haven't changed the function call parameters since the tutorial was written. – Gabe Sechan Jun 12 '14 at 12:43

1 Answers1

0

In case you are still stuck (doubtful) or if this helps someone else....

I had this issue too, but I found that using the "full" .so files from the lib folder of the trial package rather than the "standard" ones solved it for me.

As per Bob's request below:

The PDFTron SDK comes with two sets of library .so files, the standard set and a more complete full set, both available under the SDK's "lib" folder. It seems that the missing function that causes the error is not included in the standard library but is included in the full library, so this is the dependancy that must be imported instead.

I believe this is accomplished using a wizard in Eclipse (sorry, I use Android Stiudio) where you simply point to the correct file (in the 'lib/full/, whatever cpu platform' folder), or import all of them if your app covers ARM and Intel

However for Android Studio, it seems that an extra step is required, which is to package up your .so files into a .jar before imprting to the project and referencing as a file dependancy. This is documented by Assaf's answer at the bottom of Include .so library in apk in android studio.

Community
  • 1
  • 1
  • 1
    Can you elaborate on how to do that? Having a more descriptive answer will provide users with a better understanding on how your answer can help people with the same problem. – Bob. Jan 07 '15 at 14:23
  • Bob, this is really odd...I wrote an answer yesterday, but it appears to have disappeared.... is there some "approval" routing on here like when we write articles on CodeProject?. – Graham Lemon Jan 15 '15 at 09:52
  • are you sure you hit `Post Your Answer`? I've done that a few times where I forget to hit the button. Flagged answers can also be removed if they are not an actual answer (i.e. comments, spam, etc.) – Bob. Jan 15 '15 at 12:15
  • Anything's possible, but I added the text above after I noticed I could edit the existing answer. Hope this now gives enough info. – Graham Lemon Jan 15 '15 at 15:48
  • @GrahamLemon i have done exactly you have said but still getting UnsatisfiedLinkError: No implementation found for void com.pdftron.pdf.DocumentPreviewCache.Initialize(long, double) (tried Java_com_pdftron_pdf_DocumentPreviewCache_Initialize and Java_com_pdftron_pdf_DocumentPreviewCache_Initialize__JD) this error – Harsh Patel Dec 21 '17 at 07:32