不满意的链接错误:dlopen失败:找不到符号" atof"?

时间:2016-07-14 12:36:36

标签: java android android-ndk mupdf atof

我正在尝试实现mupdf库来在我的应用程序中呈现pdf文档。我的应用程序崩溃时出现以下错误日志: -

  

java.lang.UnsatisfiedLinkError:dlopen失败:找不到符号   " ATOF"由" libmupdf_java.so引用" ...                                                                                      在java.lang.Runtime.loadLibrary(Runtime.java:364)                                                                                      在java.lang.System.loadLibrary(System.java:526)                                                                                      在com.artifex.mupdfdemo.MuPDFCore。(MuPDFCore.java:15)                                                                                      在   com.inevitablesol.www.demopdf.MainActivity.onCreate(MainActivity.java:23)                                                                                      在android.app.Activity.performCreate(Activity.java:5301)                                                                                      在   android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)                                                                                      在   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2291)                                                                                      在   android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2378)                                                                                      在android.app.ActivityThread.access $ 800(ActivityThread.java:155)                                                                                      在   android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1244)                                                                                      在android.os.Handler.dispatchMessage(Handler.java:102)                                                                                      在android.os.Looper.loop(Looper.java:136)                                                                                      在android.app.ActivityThread.main(ActivityThread.java:5433)                                                                                      at java.lang.reflect.Method.invokeNative(Native Method)                                                                                      在java.lang.reflect.Method.invoke(Method.java:515)                                                                                      在   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1268)                                                                                      在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)                                                                                      在dalvik.system.NativeStart.main(本地方法)

这是我尝试实施的示例代码。

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 个答案:

答案 0 :(得分:1)

在此位置/ app / src / main /创建jniLibs文件夹。 在jnoLibs文件夹中创建armeabiarmeabi-v7a文件夹并在该文件夹中添加libmupdf.so文件。