当前位置: 代码迷 >> 综合 >> java.lang.UnsatisfiedLinkError: No implementation found for int com.hik.stunclient.StunClient.stunGe
  详细解决方案

java.lang.UnsatisfiedLinkError: No implementation found for int com.hik.stunclient.StunClient.stunGe

热度:12   发布时间:2023-12-16 14:34:43.0

海康威视萤石demo login的时候报错:

java.lang.UnsatisfiedLinkError: No implementation found for int com.hik.stunclient.StunClient.stunGetNATType



12-21 12:10:41.459 22376-22412/ezviz.ezopensdk E/art: No implementation found for int com.hik.stunclient.StunClient.stunGetNATType(java.lang.String, java.lang.String, short, java.lang.String, short) (tried Java_com_hik_stunclient_StunClient_stunGetNATType and Java_com_hik_stunclient_StunClient_stunGetNATType__Ljava_lang_String_2Ljava_lang_String_2SLjava_lang_String_2S)
12-21 12:10:41.461 22376-22412/ezviz.ezopensdk E/AndroidRuntime: FATAL EXCEPTION: Thread-3276
                                                                 Process: ezviz.ezopensdk, PID: 22376
                                                                 java.lang.UnsatisfiedLinkError: No implementation found for int com.hik.stunclient.StunClient.stunGetNATType(java.lang.String, java.lang.String, short, java.lang.String, short) (tried Java_com_hik_stunclient_StunClient_stunGetNATType and Java_com_hik_stunclient_StunClient_stunGetNATType__Ljava_lang_String_2Ljava_lang_String_2SLjava_lang_String_2S)
                                                                     at com.hik.stunclient.StunClient.stunGetNATType(Native Method)
                                                                     at com.videogo.main.AppManager.refreshNetInfo(AppManager.java:106)
                                                                     at com.videogo.openapi.EZOpenSDK$2.run(EZOpenSDK.java:119)
                                                                     at java.lang.Thread.run(Thread.java:818)


看上去是so文件没有这个方法,其实不是,其实是我的参数弄错了


原因找到了:

我在EZOpenSDK.initLib()这个方法的第三个参数写了,应该是不用写的,直接为空就行了


错误的:

EZOpenSDK.initLib(this, AppKey, "2021eb1287f1a5f8f3f13eca4cc636b0");

正确的:

 EZOpenSDK.initLib(this, AppKey, "");

/* * @ProjectName VideoGoJar* @Copyright HangZhou Hikvision System Technology Co.,Ltd. All Right Reserved* * @FileName EzvizApplication.java* @Description 这里对文件进行描述* * @author chenxingyf1* @data 2014-7-12* * @note 这里写本文件的详细功能描述和注释* @note 历史记录* * @warning 这里写本文件的相关警告*/
package com.videogo;import android.app.Application;import com.videogo.openapi.EZOpenSDK;/*** 自定义应用** @author xiaxingsuo*/
public class EzvizApplication extends Application {//private String AppKey = "开发者申请的AppKey";private String AppKey = "c5529c17211845ff977f01de7";public static EZOpenSDK getOpenSDK() {return EZOpenSDK.getInstance();}@Overridepublic void onCreate() {initSDK();}private void initSDK() {/**********国内版本初始化EZOpenSDK**************/{/*** sdk日志开关,正式发布需要设置未false*/EZOpenSDK.showSDKLog(false);/*** 设置是否支持P2P取流,详见api*/EZOpenSDK.enableP2P(true);/*** APP_KEY请替换成自己申请的*/EZOpenSDK.initLib(this, AppKey, "");}}
}