简体   繁体   English

linphone android登录错误java.lang.UnsatisfiedLinkError:setUsername

[英]linphone android login error java.lang.UnsatisfiedLinkError: setUsername

linphone for android compiled success,and I import the "linphone-android" project to Eclipse,run it in my android phone.But when I add a account or login,throw a exception: linphone for android编译成功,然后将“ linphone-android”项目导入Eclipse,在我的android手机中运行它。但是当我添加帐户或登录时,抛出异常:

No implementation found for native Lorg/linphone/core/LinphoneAuthInfoImpl;.setUsername (JLjava/lang/String;) java.lang.UnsatisfiedLinkError: setUsername 找不到本机Lorg / linphone / core / LinphoneAuthInfoImpl; .setUsername(JLjava / lang / String;)java.lang.UnsatisfiedLinkError:setUsername的实现

linphone-android libs目录

I think the question is have not load .so librarys,Log shows: 我认为问题是尚未加载.so库,日志显示:

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

Please try this solution: 请尝试以下解决方案:

Go to submodules/linphone/coreapi/linphonecore_jni.cc 转到子模块/linphone/coreapi/linphonecore_jni.cc

Edit linphonecore_jni.cc file. 编辑linphonecore_jni.cc文件。

The change is - replace JNIEXPORT with extern "C" and remove JNICALL keyword in all this getter / setters of linphone auth info. 更改是-将JNIEXPORT替换为extern“ C”,并删除所有此linphone身份信息的获取器/设置器中的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);
}

refer to Kaushik Parmar's solution . 请参阅Kaushik Parmar的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM