openwebrtc-ios-sdk icon indicating copy to clipboard operation
openwebrtc-ios-sdk copied to clipboard

strange crash when calling owr_bridge_start_in_thread()

Open portwatcher opened this issue 10 years ago • 7 comments

Firstly I built OpenWebRTC.framework 0.1 with Cerbero myself, it turned out that some lib in it does not support arm64, I can't submit an app that doesn't support arm64 to App Store.

Then I found this repo, however, I failed pod update with some error like no such file chmod_internal /path/to/pods/OpenWebRTC.framework/Commands.

But I noticed I got a OpenWebRTC.framework 0.3.1 in my cocoapods' cache. So I just replace my 0.1 framework with 0.3.1 framework, and it worked, support arm64, no crash, capable of video chat with my peer.

However my app got rejected by Apple because it crashes at launch.

I find that, when I install the app into my iPhone through XCode, everything is OK. However, when I archive it into ipa and send it to somebody, it crashes when calling owr_bridge_start_in_thread, because when I comment out this line of code, the crash disappears.

I call owr_bridge_start_in_thread() according to the bowser project. I'm wondering if this is a bug or wrong configuration with XCode or I'm using this lib wrongly.

Recently I'm really unlucky...

portwatcher avatar May 06 '15 08:05 portwatcher

I noticed that there's a method in OpenWebRTC.h of this repo called initialize and inside this method we called owr_init() and owr_run_in_background(). I used this two methods and nothing happened, the getUserMedia JS API didn't work. I also tried [OpenWebRTC initialize] and still bad luck.

portwatcher avatar May 06 '15 08:05 portwatcher

There is no support for the bridge in the SDK so you can't use that [OpenWebRTC initialize] stuff. You need to use the OpenWebRTC pod only, not the SDK pod. Also, it was a known issue in 0.3.0 that 64-bit crashed. However, I think the 0.3.1 pod fixed that, at least it should be fixed in master.

You should be able to use the OpenWebRTC pod and then import the C headers like this: #import <OpenWebRTC/owr/owr.h>

owr_bridge_start_in_thread() should work. If it doesn't, we need to investigate why it's crashing.

What is your app by the way? We're very interested to hear what people are doing with OpenWebRTC. :smile:

superdump avatar May 06 '15 08:05 superdump

Any additional information you can obtain about the crash is very welcome.

superdump avatar May 06 '15 08:05 superdump

OK, I'll try that.


My app's english name is CloudBox, it's a web apps container that makes the website more like an app. You can just take it as a new generation super power web browser.

We've already supported some PhoneGap APIs through JavaScriptCore, so I just think it would be better if we support WebRTC.

Currently it's only available on Chinese App Store. You can try the Android version if you like. By the way, it beats Chrome on Chinese App Store some time. img_1454


I can post the crash log that Apple sent me.

crash log 1 crash log 2 crash log 3

portwatcher avatar May 06 '15 09:05 portwatcher

I can't install OpenWebRTC by CocoaPods, it throws error after successfully copying OpenWebRTC.framework:

Errno::ENOENT - No such file or directory @ chmod_internal - /path/to/Pods/OpenWebRTC/OpenWebRTC.framework/Commands

And it still crashes when calling owr_bridge_start_in_thread() in the app installed with ipa, but goes smooth in the app installed by XCode.

portwatcher avatar May 06 '15 11:05 portwatcher

How is it going? Does my crash logs help you figure it out? I really want to contribute but I'm not good at C++.

portwatcher avatar May 14 '15 14:05 portwatcher

I'll have a look at this when I return to work later next week unless @Rugvip beats me to it.

superdump avatar May 16 '15 06:05 superdump