Skip to content

iOS 14.0.1 crashes with bundled WebRTC.framework when calling (begin|end)GeneratingDeviceOrientationNotifications M69 and M75 but not M84 #578

@pasmat

Description

@pasmat

Please read first!

Please use Public Google Group (mailing list) for general technical discussions and questions.

  • [*] I have used Google with the error message or bug in association with the library and Cordova words to make sure the issue I'm reporting is only related to iOSRTC.
  • I have provided steps to reproduce (e.g. sample code or updated extra/renderer-and-libwebrtc-tests.js file).
  • [*] I have provided third party library name and version, ios, Xcode and plugin version and adapter.js version if used.

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed, removing this checkbox will result in automatic closed issue.

Versions affected

  • Cordova version 10.0.0:
  • Cordova iOS version 6.1.1:
  • Plugin version master branch:
  • iOS version 14.0.1:
  • Xcode version 12.0.1:
  • WebRTC-adapter version 7.4.0:
  • WebRTC Framework version M69:

Description

The bundled WebRTC Framework causes crash, due to RTCCameraVideoCapturer.startCapture calling UIDevices beginGeneratingDeviceOrientationNotifications on non main thread

I used the linked guide to build WebRTC framework and modified RTCCameraVideoCapturer.m so that instead of calling the beginGeneratingDeviceOrientationNotifications and endGeneratingDeviceOrientationNotifications via RTCDispatchers RTCDispatcherTypeCaptureSession, I call them on RTCDispatcherTypeMain, and it works as expected.

I can't find any documentation regarding the changes to this functions behavior on iOS 14, but this works as expected on my iPad running iOS 13, and used to work on my iPhone running iOS 14.

Steps to reproduce

Run anything on iOS 14.0.1 that accesses the camera using cordova-plugin-iosrtc

Expected results

No crash

Actual results

Crash
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'threading violation: expected the main thread'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions