1

我在以下行收到错误:

AgoraAPIOnlySignal m_agoraAPI = AgoraAPIOnlySignal.getInstance(this, appID);

在 AG 应用程序中。谁能让我知道我哪里出错了?

如果您需要堆栈跟踪

 java.lang.UnsatisfiedLinkError: No implementation found for void io.agora.NativeAgoraAPI.jniInitGet() (tried Java_io_agora_NativeAgoraAPI_jniInitGet and Java_io_agora_NativeAgoraAPI_jniInitGet__)
    at io.agora.NativeAgoraAPI.jniInitGet(Native Method)
    at io.agora.AgoraAPIOnlySignal.getInstance(AgoraAPIOnlySignal.java:60)
    at live.smartify.community.smartliving.security.application.AGApplication.setupAgoraEngine(AGApplication.java:82)
    at live.smartify.community.smartliving.security.application.AGApplication.onCreate(AGApplication.java:67)
4

1 回答 1

0

Agora Signaling SDK 是一个单独的 SDK,没有与 Agora 的原生 SDKS 捆绑,因此您必须与原生 SDK 分开下载和链接/添加到您的项目。

Agora Signaling SDK 已弃用,您应该使用Agora.io 的 RTM SDK,它具有 Signaling SDK 的所有功能以及一些新功能。

确保下载 SDK 并将其链接到您的项目中。在项目中安装 SDK 后,您可以使用以下命令进行初始化:

public void init() {
    try {
        mRtmClient = RtmClient.createInstance(mContext, APPID, new RtmClientListener() {
            @Override
            public void onConnectionStateChanged(int state, int reason) {
                Log.d(TAG, "Connection state changes to " + state + " reason: " + reason);
            }

            @Override
            public void onMessageReceived(RtmMessage rtmMessage, String peerId) {
                String msg = rtmMessage.getText();
                Log.d(TAG, "Message received " + " from " + peerId + msg);
            }
        });
    } catch (Exception e) {
        Log.d(TAG, "RTM SDK initialization fatal error!");
        throw new RuntimeException("You need to check the RTM initialization process.");
    }
}

请参阅完整的 Android RTM SDK 快速入门指南:https ://docs.agora.io/en/Real-time-Messaging/messaging_android?platform=Android

于 2019-10-16T04:35:04.613 回答