不满意的链接错误:dlopen失败:无法找到符号"atof"? [英] Unsatisfied Link Error: dlopen failed: cannot locate symbol "atof"?

查看:251
本文介绍了不满意的链接错误:dlopen失败:无法找到符号"atof"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现mupdf库以在我的应用程序中呈现pdf文档.我的应用程序崩溃并显示以下错误日志:-

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失败:无法找到符号 "libmupdf_java.so"引用的"atof" ... 在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) 在java.lang.reflect.Method.invokeNative(本机方法) 在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(本机方法)

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

推荐答案

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

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.

这篇关于不满意的链接错误:dlopen失败:无法找到符号"atof"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆