2013-06-05 108 views
1

linphone for android編譯成功,我導入「linphone-android」項目到Eclipse,在我的android手機中運行它。但是當我添加一個帳戶或登錄時,拋出一個例外:linphone android登錄錯誤java.lang.UnsatisfiedLinkError:setUsername

沒有實現發現本地Lorg/Linphone中/核心/ LinphoneAuthInfoImpl; .setUsername(JLjava /朗/字符串;) java.lang.UnsatisfiedLinkError中:setUsername

linphone-android libs Directory

我覺得問題是沒有加載.so librarys,日誌顯示:

No JNI_OnLoad found in /data/data/org.linphone/lib/libxxx.so 

回答

2

請嘗試此解決方案:

轉到子模塊/ Linphone中/ coreapi/linphonecore_jni.cc

編輯linphonecore_jni.cc文件。

更改是 - 用extern「C」替換JNIEXPORT並在所有此linphone驗證信息的getter/setter中刪除JNICALL關鍵字。

/* 
* Class:  org_linphone_core_LinphoneAuthInfoImpl 
* Method: setUsername 
* Signature: (JLjava/lang/String;)V 
*/ 
extern "C" void Java_org_linphone_core_LinphoneAuthInfoImpl_setUsername (JNIEnv *env, jobject, jlong auth_info, jstring jusername) { 
const char* username = jusername?env->GetStringUTFChars(jusername, NULL):NULL; 
linphone_auth_info_set_username((LinphoneAuthInfo*)auth_info,username); 
if (username) env->ReleaseStringUTFChars(jusername, username); 
} 

參照Kaushik Parmar's solution