当我尝试结束通话(关闭连接)时 WebRTC 崩溃
WebRTC crash when I try to end a call (close connection)
在 android WebRTC 的实现中,我检查了多个讨论,所有这些都提到了卸载的 .so 文件,我什至尝试使用 https://github.com/KeepSafe/ReLinker 来保留这些 .so 文件。
这是问题的崩溃日志:
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.access0(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)
非常感谢 的 Dhilip。他对自己的问题(关于 objective C)的解决方案帮助了我。我在这里引用他的建议:
I was trying to create PeerConnectionFactory and LocalVideoTrack in worker thread! Problem solved when I moved those to main thread.
根据该建议,我将代码更新为:
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
peerConnectionClient.createPeerConnectionFactory(getActivity(),peerConnectionParameters, this);
});
这为我解决了崩溃问题。我仍在寻找对此的解释。所以如果你知道请补充细节。
根据错误 reported here and here,您似乎只需要创建一次 peerConnectionFactory。每次创建它时都会尝试创建一个音频设备模块,但 Android.
只支持一个
此外(如果使用 MediaSoup)确保您只创建一个设备并在完成后释放它。
在 android WebRTC 的实现中,我检查了多个讨论,所有这些都提到了卸载的 .so 文件,我什至尝试使用 https://github.com/KeepSafe/ReLinker 来保留这些 .so 文件。
这是问题的崩溃日志:
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.access0(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)
非常感谢
I was trying to create PeerConnectionFactory and LocalVideoTrack in worker thread! Problem solved when I moved those to main thread.
根据该建议,我将代码更新为:
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
peerConnectionClient.createPeerConnectionFactory(getActivity(),peerConnectionParameters, this);
});
这为我解决了崩溃问题。我仍在寻找对此的解释。所以如果你知道请补充细节。
根据错误 reported here and here,您似乎只需要创建一次 peerConnectionFactory。每次创建它时都会尝试创建一个音频设备模块,但 Android.
只支持一个此外(如果使用 MediaSoup)确保您只创建一个设备并在完成后释放它。