Unsatisfied Link Error: dlopen failed: cannot locate symbol "atof"? [duplicate]
Asked Answered
S

1

0

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);
    }
}
Spirochete answered 14/7, 2016 at 12:36 Comment(4)
have you added .so file?Repay
@Pravin I first build the mupdf libarary from source then created a project with package name com.artifex.mupdfdemo then made a .arr file and used it as a module in my project.Spirochete
ok.. in downloaded mupdf project search for libmupdf.so file and add that file into your projectRepay
@Pravin the error message clearly says that the .so file is already present in the project; the problem is loading it due to the way it has been complied.Lippmann
R
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.

Repay answered 14/7, 2016 at 12:50 Comment(2)
Thank you Pravin I made a directory named jniLibs and added two folders armeabi and armeabi-v7a and added libmupdf_java.so in both the folders.And I am still getting the same error.Spirochete
refer ssahinkoc.blogspot.in/2014/10/…Repay

© 2022 - 2024 — McMap. All rights reserved.