UnsatisfiedLinkError in pjsip library

走远了吗. 提交于 2019-12-31 05:27:31

问题


I build Pjsip library and use its sample in android studio .

question

When I run that i got this error.How could I solve it ? thanks in advance.

exception

jsip.pjsua2.app E/AndroidRuntime: FATAL EXCEPTION: main Process: org.pjsip.pjsua2.app, PID: 4360 java.lang.UnsatisfiedLinkError: No implementation found for void org.pjsip.pjsua2.pjsua2JNI.swig_module_init() (tried Java_org_pjsip_pjsua2_pjsua2JNI_swig_1module_1init and Java_org_pjsip_pjsua2_pjsua2JNI_swig_1module_1init__) at org.pjsip.pjsua2.pjsua2JNI.swig_module_init(Native Method) at org.pjsip.pjsua2.pjsua2JNI.(pjsua2JNI.java:2351) at org.pjsip.pjsua2.Endpoint.(Endpoint.java:68) at org.pjsip.pjsua2.app.MyApp.(MyApp.java:296) at org.pjsip.pjsua2.app.MainActivity.onCreate(MainActivity.java:92) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442) at android.app.ActivityThread.access$800(ActivityThread.java:156) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:211) at android.app.ActivityThread.main(ActivityThread.java:5389) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)


回答1:


It may happen for several reasons. First, check if you attached the native library correctly. For that create a folder named "jniLibs" into the projects

app/src/main/jniLibs

then put your armeabi architecture library like

armeabi/libpjsua2.so

for other architecture like armeabi-v7a use

armeabi-v7a/libpjsua2.so

like this.

there are other reasons may happen. If you build pjsip library for armeabi architecture only and running your application in an x86 architecture device then this error may occur. So check it also if you have built it for that application.




回答2:


Please take a look at this thread: building pjsua2 dll

the important thing to know here is that the error you show in your question is caused by the fact that the pjsua2.dll (a c++ dll) is not in your output directory.



来源:https://stackoverflow.com/questions/34115790/unsatisfiedlinkerror-in-pjsip-library

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