I am trying to implement the mupdf library to render pdf documents in my app.My app crashes with the following error log:-
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "atof" referenced by "libmupdf_java.so"... at java.lang.Runtime.loadLibrary(Runtime.java:364) at java.lang.System.loadLibrary(System.java:526) at com.artifex.mupdfdemo.MuPDFCore.(MuPDFCore.java:15) at com.inevitablesol.www.demopdf.MainActivity.onCreate(MainActivity.java:23) at android.app.Activity.performCreate(Activity.java:5301) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2291) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5433) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(Native Method)
This is the sample code that I am trying to implement.
package com.inevitablesol.www.demopdf;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.RelativeLayout;
import com.artifex.mupdfdemo.FilePicker;
import com.artifex.mupdfdemo.MuPDFCore;
import com.artifex.mupdfdemo.MuPDFPageAdapter;
import com.artifex.mupdfdemo.MuPDFReaderView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RelativeLayout layout = (RelativeLayout) findViewById(R.id.main_layout);
MuPDFCore core = null;
try {
core = new MuPDFCore(this,"/storage/emulated/0/sample.pdf");
} catch (Exception e) {
e.printStackTrace();
}
MuPDFReaderView reader = new MuPDFReaderView(this);
reader.setAdapter(new MuPDFPageAdapter(this, new FilePicker.FilePickerSupport() {
@Override
public void performPickFor(FilePicker filePicker) {
}
},core));
layout.addView(reader);
}
}