2

I built mupdf for android , and it runs fine as a project itself. My objective is to send intents to it using my main project. This is the code i am using (from my project):

 Uri uri = Uri.parse(Environment.getExternalStorageDirectory()+ "/GeneratedPageNumber.pdf");

             Intent intent = new Intent(MainActivity.this,com.artifex.mupdfdemo.MuPDFActivity.class);

             intent.setAction(Intent.ACTION_VIEW);

             intent.setData(uri);

             startActivity(intent);

I get this error:

06-16 13:42:14.736: E/AndroidRuntime(9479): FATAL EXCEPTION: main 06-16 13:42:14.736: E/AndroidRuntime(9479): java.lang.ExceptionInInitializerError 06-16 13:42:14.736: E/AndroidRuntime(9479): at com.artifex.mupdfdemo.MuPDFActivity.openFile(MuPDFActivity.java:213) 06-16 13:42:14.736: E/AndroidRuntime(9479): at com.artifex.mupdfdemo.MuPDFActivity.onCreate(MuPDFActivity.java:309) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.app.Activity.performCreate(Activity.java:4465) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1051) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.app.ActivityThread.access$600(ActivityThread.java:123) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.os.Handler.dispatchMessage(Handler.java:99) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.os.Looper.loop(Looper.java:137) 06-16 13:42:14.736: E/AndroidRuntime(9479): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-16 13:42:14.736: E/AndroidRuntime(9479): at java.lang.reflect.Method.invokeNative(Native Method) 06-16 13:42:14.736: E/AndroidRuntime(9479): at java.lang.reflect.Method.invoke(Method.java:511) 06-16 13:42:14.736: E/AndroidRuntime(9479): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825) 06-16 13:42:14.736: E/AndroidRuntime(9479): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:592) 06-16 13:42:14.736: E/AndroidRuntime(9479): at dalvik.system.NativeStart.main(Native Method) 06-16 13:42:14.736: E/AndroidRuntime(9479): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load mupdf: findLibrary returned null 06-16 13:42:14.736: E/AndroidRuntime(9479): at java.lang.Runtime.loadLibrary(Runtime.java:365) 06-16 13:42:14.736: E/AndroidRuntime(9479): at java.lang.System.loadLibrary(System.java:535) 06-16 13:42:14.736: E/AndroidRuntime(9479): at com.artifex.mupdfdemo.MuPDFCore.(MuPDFCore.java:14)

Note that the build of the MuPDF project runs fine by itself, so you could almost rule out the fact that there are build errors.

I have marked the Mupdf project as a library , and have referenced it from my project. What is wrong ?

harveyslash
  • 5,906
  • 12
  • 58
  • 111

1 Answers1

0

i haveing same issue, i got the solution,

Problem is i am try to run project on genymotion and Genymotion is a x86 platform, so compile the application to target x86. in MuPdf must be ARM,

You may be able to install ARM support manually : http://forum.xda-developers.com/showthread.php?t=2528952

its work fine.

Amit Prajapati
  • 13,525
  • 8
  • 62
  • 84