cordova-rtc / cordova-plugin-iosrtc

Cordova iOS plugin exposing the WebRTC W3C API
MIT License
688 stars 340 forks source link

cordova iosrtc app crash on iphone device - 'NSInternalInconsistencyException', #753

Closed Sukumaran001 closed 2 years ago

Sukumaran001 commented 2 years ago

i have an app crash issue on ios real device

**libc++abi: terminating with uncaught exception of type NSException dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Call must be made on main thread' terminating with uncaught exception of type NSException

Apple macOS: 11.6.6 Big Sur Xcode: 13.2.1 ios-deploy: 1.11.4 CocoaPods: 1.11.3 cordova : 11.0.0 cordova-platform-ios : 6.2.0 webrtc-adapter-version : 8.1.1 cordova-plugin-iosrtc version : 8.0.0 iOS version : 15.2

please help someone help me

hthetiot commented 2 years ago

Can you provide the cordova-plugin-iosrtc version pls.

hthetiot commented 2 years ago

Can you provide also the ios device version pls.

hthetiot commented 2 years ago

Pls also provide steps to reproduce. See details requirements.

https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/.github/ISSUE_TEMPLATE.md#steps-to-reproduce

Unless information are provided no one can help you.

  1. iOS version
  2. Cordova-plugin-iosrtc version
  3. Steps to reproduce
Sukumaran001 commented 2 years ago

@hthetiot how to find webrtc-framework version?

hthetiot commented 2 years ago

@Sukumaran001 I have not asked you webrtc-framework version and it's not part of the requirement I linked that is required to create issue in that repository.

I literally listed what you need to provide here: https://github.com/cordova-rtc/cordova-plugin-iosrtc/issues/753#issuecomment-1154079525

Your issue have nothing to do with webrtc framework version, since you have not provided your cordova-plugin-iosrtc version its not possible to me to give you proper answer. If you actually read the README you will see latest cordova-plugin-iosrtc come with M89 (that why it's v 8.0.x).

Note that i reserve the right to close this issue and ban you if you do not behave and actually helping yourself by providing what I have asked you.

hthetiot commented 2 years ago

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.

Last chance, open source maintainer are not supposed to teach you to read.

Sukumaran001 commented 2 years ago

@hthetiot These are all my cordova details.

Apple macOS: 11.6.6 Big Sur Xcode: 13.2.1 ios-deploy: 1.11.4 CocoaPods: 1.11.3 Cordova version : 11.0.0 Cordova iOS version:6.2.0 cordova-Plugin-version: 8.0.1 webrtc-adapter-version : 8.1.1 iOS version : 15.2

Sukumaran001 commented 2 years ago

@hthetiot cordova-Plugin-version: 8.0.1(iosrtc)

hthetiot commented 2 years ago

@Sukumaran001

Missing Steps to reproduce.

Sukumaran001 commented 2 years ago

hello @hthetiot , sorry for misunderstanding Thanks for giving me one more chance

Description The app crashes While using iosrtc with cordova in a iphone device. however this works fine on the stimulator

steps to reproduce:

  1. first create new cordova project
  2. Add inappbrowser plugin.
  3. then add iosrtc plugin
  4. Load a html page which uses webrtc, requires media and camera permission.
  5. deploy on iphone device (i am using iphone 12 mini).

Expected Results, App Should work without crashing

Actual Result, App crashes on real device While loading right after the app request for media and camera permission

Requirements Cordova version: 11.0.0 Cordova iOS version: 6.2.0 cordova-Plugin-iosrtc version : 8.0.1 iOS version : 15.2 Xcode version : 13.2.1 WebRTC-adapter version : 8.1.1

Error Log:

libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Call must be made on main thread'
terminating with uncaught exception of type NSException

Thing that i have already tried: I took the code snippet from
https://github.com/cordova-rtc/cordova-plugin-iosrtc/issues/426#issuecomment-547861475 and https://github.com/cordova-rtc/cordova-plugin-iosrtc/issues/426#issuecomment-547885518. i used this inside files ,iosrtc plugin, and pluginUserMedia. but it did not work for me.

See and run my demo project also

https://github.com/Sukumaran001/Cordova_demo_iosrtc.git

Thanks in advance for your help

hthetiot commented 2 years ago

OK if I look at your sample, it open the webrtc javascript example in in app browser (https://github.com/Sukumaran001/Cordova_demo_iosrtc/blob/929e44c6a19128a80155176a4891c46f2245eae2/www/js/index.js#L7)

Cordova-plugin-iosrtc does not expose webrtc in in app browser, meaning if you have the issue that not cordova-plugin-iosrtc related.

For instance in your sample if you remove cordova-plugin-iosrtc, it should change nothing.

Also cordova-plugin-iosrtc is only required for iOS bellow 14.3, since after 14.3 webrtc is included in WkWebview, and that why you can actually use it in in app browser.

Cordova-plugin-iosrtc is only available in WKWebview after you called registerGlobals (see https://github.com/cordova-rtc/cordova-plugin-iosrtc#usage). One way to confirm that the issue is not related to cordova-plugin-iosrtc is to properly use it and you have a sample application here as described in the issue requirement that you have not properly read (https://github.com/cordova-rtc/cordova-plugin-iosrtc#sample-application).

hthetiot commented 2 years ago

@Sukumaran001 if you provide an actual way to reproduce that is valid, I will reopen, but currently it seems that your sample does not initialize cordova-plugin-iosrtc and run webrtc sample in a in app browser instead and therefore it's not used and your issue is not related. You may try to reproduce with the sample app https://github.com/cordova-rtc/cordova-plugin-iosrtc#sample-application