{"id":2814,"date":"2022-08-30T15:28:00","date_gmt":"2022-08-30T15:28:00","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/19\/android-mupdf-libmupdf-so-runtime-error-no-implementation-found-for-native-openfile-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:28:00","modified_gmt":"2022-08-30T15:28:00","slug":"android-mupdf-libmupdf-so-runtime-error-no-implementation-found-for-native-openfile-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/android-mupdf-libmupdf-so-runtime-error-no-implementation-found-for-native-openfile-collection-of-common-programming-errors\/","title":{"rendered":"android mupdf libmupdf.so runtime error &ldquo;No implementation found for native openFile&rdquo;-Collection of common programming errors"},"content":{"rendered":"<p>I just finished compiling mupdf from mupdf.com on my mac. Took some time to figure it out but now I have a libmupdf.so in my libs\/armeabi folder.<\/p>\n<p>They provide an example of this class called MuPDFCore.java which is viewable here: http:\/\/mupdf.com\/repos\/mupdf\/android\/src\/com\/artifex\/mupdf\/MuPDFCore.java<\/p>\n<p>I used this class in my project and it says the following in LogCat:<\/p>\n<blockquote>\n<p>Trying to load lib \/data\/data\/com.myapp.android\/lib\/libmupdf.so 0x4070e050<\/p>\n<p>Added shared lib \/data\/data\/com.myapp.android\/lib\/libmupdf.so 0x4070e050<\/p>\n<p>No JNI_OnLoad found in \/data\/data\/com.myapp.android\/lib\/libmupdf.so 0x4070e050, skipping init<\/p>\n<p>No implementation found for native Lcom\/myapp\/android\/viewer\/MuPDFCore;.openFile (Ljava\/lang\/String;)I<\/p>\n<p>DEBUG\/AndroidRuntime(27523): Shutting down VM<\/p>\n<p>WARN\/dalvikvm(27523): threadid=1: thread exiting with uncaught exception (group=0x400ee760)<\/p>\n<p>ERROR\/AndroidRuntime(27523): FATAL EXCEPTION: main<\/p>\n<p>ERROR\/AndroidRuntime(27523): java.lang.UnsatisfiedLinkError: openFile<\/p>\n<\/blockquote>\n<p>As far as I know the library is loading, before I figured out how to compile the library it kept crashing and saying the &#8220;mupdf&#8221; is a null link.<\/p>\n<p>Their example pretty much says that openFile is a native function &#8230; Just when I thought I figured this out another problem pops up. Ive been working on it all day. Any input would be great!<\/p>\n<p>Is it a bad compile? I didn&#8217;t get any errors in the terminal.<\/p>\n<ol>\n<li>\n<p>I too was able to build the mupdf library. I got it working on the emulator. I have an app. that uses the mupdf library to save jpg files to the sdcard.<\/p>\n<p>This works on the <strong>emulator<\/strong> as well as on a <strong>Android 2.2 device API level 8<\/strong> (LG Optimus). However, when run on the <strong>Samsung Galaxy S<\/strong> (Android 2.1-update1 API level 7), I&#8217;m getting the error :<\/p>\n<pre><code>ERROR\/AndroidRuntime(8715): Caused by: java.lang.UnsatisfiedLinkError: Library mupdf not found\n<\/code><\/pre>\n<p>I used the ndk: android-ndk-r5b<\/p>\n<p>Any ideas on what might be causing the error?!?!<\/p>\n<\/li>\n<li>\n<p>I think you didn&#8217;t change the your function names in mupdf.c to your corresponding java package name, that means, you should change the function Java_com_artifex_mupdf_MuPDFCore_openFile in your mupdf.c to Java_com_myapp_android_viewer_openFile.<\/p>\n<\/li>\n<li>\n<p>At file mupdf.c L18-19:<\/p>\n<pre><code>#define JNI_FN(A) Java_com_artifex_mupdfdemo_ ## A \n#define PACKAGENAME \"com\/artifex\/mupdfdemo\"\n<\/code><\/pre>\n<p>Change both to your package name.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-02-19 02:16:27. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I just finished compiling mupdf from mupdf.com on my mac. Took some time to figure it out but now I have a libmupdf.so in my libs\/armeabi folder. They provide an example of this class called MuPDFCore.java which is viewable here: http:\/\/mupdf.com\/repos\/mupdf\/android\/src\/com\/artifex\/mupdf\/MuPDFCore.java I used this class in my project and it says the following in LogCat: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2814","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2814"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2814\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}