我尝试结束通话时WebRTC崩溃(关闭连接)

时间:2018-06-12 12:53:12

标签: java android exception crash webrtc

WebRTC 的android实现中,我已经检查过所有关于卸载的.so文件的所有提及,我甚至尝试使用https://github.com/KeepSafe/ReLinker来保持这些.so文件。< / p>

以下是问题的崩溃日志:

E/art: No implementation found for void org.webrtc.voiceengine.WebRtcAudioRecord.nativeDataIsRecorded(int, long) (tried Java_org_webrtc_voiceengine_WebRtcAudioRecord_nativeDataIsRecorded and Java_org_webrtc_voiceengine_WebRtcAudioRecord_nativeDataIsRecorded__IJ)
E/AndroidRuntime: FATAL EXCEPTION: AudioRecordJavaThread
              Process: app.lov.com.lov_android_app, PID: 23128
              java.lang.UnsatisfiedLinkError: No implementation found for void org.webrtc.voiceengine.WebRtcAudioRecord.nativeDataIsRecorded(int, long) (tried Java_org_webrtc_voiceengine_WebRtcAudioRecord_nativeDataIsRecorded and Java_org_webrtc_voiceengine_WebRtcAudioRecord_nativeDataIsRecorded__IJ)
                  at org.webrtc.voiceengine.WebRtcAudioRecord.nativeDataIsRecorded(Native Method)
                  at org.webrtc.voiceengine.WebRtcAudioRecord.access$600(WebRtcAudioRecord.java:26)
                  at org.webrtc.voiceengine.WebRtcAudioRecord$AudioRecordThread.run(WebRtcAudioRecord.java:90)
E/art: No implementation found for void org.webrtc.voiceengine.WebRtcAudioTrack.nativeGetPlayoutData(int, long) (tried Java_org_webrtc_voiceengine_WebRtcAudioTrack_nativeGetPlayoutData and Java_org_webrtc_voiceengine_WebRtcAudioTrack_nativeGetPlayoutData__IJ)

2 个答案:

答案 0 :(得分:0)

非常感谢来自https://stackoverflow.com/a/30803727/656600的Dhilip。他对自己问题(关于目标C)的解决方案帮助了我。我在这里引用他的建议:

  

我试图在工作线程中创建PeerConnectionFactory和LocalVideoTrack!当我把它们移到主线程时,问题就解决了。

根据该建议,我将代码更新为:

Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
    peerConnectionClient.createPeerConnectionFactory(getActivity(),peerConnectionParameters, this);
});

这解决了我的崩溃。我仍然在寻找解释。如果您知道,请添加详细信息。

答案 1 :(得分:0)

根据bug reported here and here,看来你只需要创建peerConnectionFactory 一次。每次创建时,它都会尝试创建一个音频设备模块,但 Android 仅支持一个。

另外(如果使用 MediaSoup)请确保您只创建一个设备并在完成后释放它。