Caused by: java.lang.UnsatisfiedLinkError: Library pjsua2 not found

I am using pjsua2 lib for voip calling and after building sample application there is a file named pjsua2.so has been created in lib->armebie folder .Now this sample application is running well in version 4.1.1 but same application crashing in version 2.2 and giving exception

04-05 13:27:11.936: W/dalvikvm(8936): VFY: unable to resolve virtual method 81: Ljava/lang/String;.isEmpty ()Z
04-05 13:27:12.236: W/dalvikvm(8936): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lorg/pjsip/pjsua2/app/MyApp;.<clinit>
04-05 13:27:12.236: W/dalvikvm(8936): threadid=1: thread exiting with uncaught exception (group=0x400207d8)
04-05 13:27:12.256: E/AndroidRuntime(8936): FATAL EXCEPTION: main
04-05 13:27:12.256: E/AndroidRuntime(8936): java.lang.ExceptionInInitializerError
04-05 13:27:12.256: E/AndroidRuntime(8936):     at org.pjsip.pjsua2.app.MainActivity.onCreate(MainActivity.java:93)
04-05 13:27:12.256: E/AndroidRuntime(8936):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-05 13:27:12.256: E/AndroidRuntime(8936):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633)
04-05 13:27:12.256: E/AndroidRuntime(8936):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685)
04-05 13:27:12.256: E/AndroidRuntime(8936):     at android.app.ActivityThread.access$2300(ActivityThread.java:126)
04-05 13:27:12.256: E/AndroidRuntime(8936):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)

So can any one tell me the issue ??

here is make file

include ../../../../../build.mak

LOCAL_PATH  := $(PJDIR)/pjsip-apps/src/swig/java/android
include $(CLEAR_VARS)

LOCAL_MODULE    := libpjsua2
LOCAL_CFLAGS    := $(APP_CFLAGS) -frtti -fexceptions
LOCAL_LDFLAGS   := $(APP_LDFLAGS)
LOCAL_LDLIBS    := $(APP_LDLIBS)
LOCAL_SRC_FILES := ../output/pjsua2_wrap.cpp

include $(BUILD_SHARED_LIBRARY)

Answers


Your problem is related to the path of the pjsua2 library. Check in your source where you load the library. Try to add this static block a static :

static {
System.load("path to your library";
System.out.println("library loaded");
}

When you start to build PJSUA2 don't forget to build it for every armeabi you are going to use. For example: TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags.


Need Your Help

BizTalk polling from SQL - Commit/Rollback transaction

sql biztalk

I have a receive location which is doing polling on a stored procedure with WCF-SQL adapter.

Parsing HTML File using cheerio

jquery html parsing cheerio

I have a HTML Document which I would like to parse. I am trying to use cheerio to parse the HTML file.