在Android上使用Vidyo SDK的UnsatisfiedLinkError

时间:2018-03-14 17:45:29

标签: android vidyo

尝试在Android上集成Vidyo SDK我发现当我运行应用程序时崩溃:

java.lang.UnsatisfiedLinkError: No implementation found for long com.vidyo.VidyoClient.Connector.Connector.constructNative(java.lang.Object, com.vidyo.VidyoClient.Connector.Connector$ConnectorViewStyle, int, java.lang.String, java.lang.String, long)
(tried Java_com_vidyo_VidyoClient_Connector_Connector_constructNative and 
Java_com_vidyo_VidyoClient_Connector_Connector_constructNative__Ljava_lang_Object_2Lcom_vidyo_VidyoClient_Connector_Connector_00024ConnectorViewStyle_2ILjava_lang_String_2Ljava_lang_String_2J)                                                                                    
at com.vidyo.VidyoClient.Connector.Connector.constructNative(Native Method)
at com.vidyo.VidyoClient.Connector.Connector.<init>(Connector.java:328)

我已添加jar,所有平台的.so和jniDir的build.gradle选项,并将jar包含为依赖。

我已经下载了演示应用,似乎工作正常,但我看不到差异。

的build.gradle:

api files('src/main/jniLibs/vidyoclient.jar')
sourceSets {
    main {
        jniLibs.srcDirs = ['src/main/jniLibs/']
    }
}

连接代码:

int persons = 1;
vidyoConnector = new Connector(videoView, Connector.ConnectorViewStyle.VIDYO_CONNECTORVIEWSTYLE_Default, persons, "warning all@VidyoConnector info@VidyoClient", "", 0L);
vidyoConnector.showViewAt(videoView, 0, 0, videoView.getWidth(), videoView.getHeight());
vidyoConnector.connect("prod.vidyo.io", getIntent().getStringExtra("token"), "TODO", getIntent().getStringExtra("resource_id"), VideoChatActivity.this);

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。问题是文档从未说过在使用Connector类之前应该运行此代码:

    ConnectorPkg.setApplicationUIContext(this)
    ConnectorPkg.initialize()