Unsatisfied Link Error: dlopen failed: cannot locate symbol “atof”? [duplicate]

柔情痞子 提交于 2020-01-07 07:43:21

问题


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);
    }
}

回答1:


Create jniLibs folder at this location /app/src/main/. And in jnoLibs folder create armeabi, armeabi-v7a folder and add libmupdf.so file in that folders.



来源:https://stackoverflow.com/questions/38374399/unsatisfied-link-error-dlopen-failed-cannot-locate-symbol-atof

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!