Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found #6

Closed
yehorchankov opened this issue Feb 7, 2020 · 5 comments

Comments

@yehorchankov
Copy link

I am trying to run the project and got stuck with the exception. The project builds successfully and tries to run on my android device, but I have the following error:

2020-02-07 15:36:02.087 23982-23982/com.tencent.squeezencnn E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.tencent.squeezencnn, PID: 23982
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found
        at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
        at java.lang.System.loadLibrary(System.java:1669)
        at com.tencent.squeezencnn.SqueezeNcnn.<clinit>(SqueezeNcnn.java:27)
        at com.tencent.squeezencnn.MainActivity.<init>(MainActivity.java:39)
        at java.lang.Class.newInstance(Native Method)
        at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
        at android.app.Instrumentation.newActivity(Instrumentation.java:1216)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2864)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6806)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

Previously I had similar exception, but with libomp.so file. I could solve it by creating app/src/jniLibs/arm64-v8a directory and placing libomp.so file from internet in the directory. When I try to do the same, but with libpthread.so.0 file, I have an error.

My working environment:
Android 9 device
Android Studio 3.5.3
Ubuntu 19.04
Ndk 21.0.6113669

@jiayisong
Copy link

jiayisong commented Apr 1, 2020

@yehorchankov NDK version too high

@yehorchankov
Copy link
Author

@jiayisong did downgrading the NDK fix the issue? To which version of NDK should I roll back?

@laoxihongshi
Copy link

@jiayisong did downgrading the NDK fix the issue? To which version of NDK should I roll back?

r19c can fix this issue.

@jiayisong
Copy link

@jiayisong did downgrading the NDK fix the issue? To which version of NDK should I roll back?

Yes,I solved this problem with 19.2.5345600.

@nihui
Copy link
Owner

nihui commented Jun 16, 2020

The project should work properly with ndk-r21d now

@nihui nihui closed this as completed Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants