App crash with CometChat.startCall while debugging in Xcode

iOS app crashes when attempting to pick up a video call while connected to the Xcode debugger. Running the app without the being attached to the debugger does work and successful connects a video call. My concern is that a threading issue in the SDK could cause intermittent issues in production.

libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'threading violation: expected the main thread'
terminating with uncaught exception of type NSException

When I comment out the startCall function, the app does not crash but then the video call doesn’t start.

if let sessionId = receivedCall?.sessionID {
    CometChat.acceptCall(sessionID: sessionId, onSuccess: { [weak self](call) in
        if let _ = call {
            DispatchQueue.main.async {
                let callSettings = CallSettings.CallSettingsBuilder(callView: self!.view, sessionId:sessionId).build()
                CometChat.startCall(callSettings: callSettings, userJoined: { (user_joined) in
                    print("userJoined")
                }, userLeft: { (user_left) in
                    print("userLeft")
                }, userListUpdated: { (userList) in
                   print("userList")
                }, audioModesUpdated: { (audioList) in
                   print("audioList")
                }, onError: { (exception) in
                    DispatchQueue.main.async {
                        self?.dismiss(animated: true, completion: nil)
                    }
                }, callEnded: { [weak self](call_ended) in
                    DispatchQueue.main.async {
                        self?.dismiss(animated: true, completion: nil)
                    }
                })
            }
        }
    }, onError: { (error) in
        print("onError")
    })

}

Xcode: 12.4
CometChat Pro SDK: 2.3.2 & 2.3.4
iOS: 14.4.2
Tested with an iPhone X and iPhone 6.

Hey @blacktop,

We had reached out to you and discussed this issue via email. Feel free to write to us at help@cometchat.com for further technical help.

Thank you.

Regards,
Provesha

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.