I am facing crash in the following code only in iOS 11.2. I am using swift 4.0. I tried to debug for hours to reproduce the crash but could not succeed. Here is the code
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;
}
Here is crashlytics report.
I shall be very thankful for any help.