我仅在 iOS 11.2 中面临以下代码崩溃。我正在使用 swift 4.0。我试图调试几个小时以重现崩溃但未能成功。这是代码
func prepareNewConnection(conn:String) -> RTCPeerConnection {
let uuid = UIDevice.current.identifierForVendor?.uuidString
localAudioTrack = peerConnectionFactory.audioTrack(withTrackId: uuid!)
mediaStream = peerConnectionFactory.mediaStream(withStreamId: LOCAL_MEDIA_STREAM_ID)
if(localAudioTrack != nil && mediaStream != nil)
{
mediaStream.addAudioTrack(localAudioTrack!) //Crash on this line
}
let pc = peerConnectionFactory.peerConnection(with: rtcConfig, constraints: mediaConstraints, delegate: self)
if(mediaStream != nil)
{
pc.add(mediaStream)
}
return pc;
}
这是崩溃分析报告。
我将非常感谢任何帮助。