Crash when another client connects to the session
Error log:
2017-01-06 10:32:05.702 [info][tid:com.facebook.react.JavaScript] Running application "OpenTokVideoCall" with appParams: {"rootTag":1,"initialProps":{}}. DEV === true, development-level warning are ON, performance optimizations are OFF libc++abi.dylib: terminating with uncaught exception of type NSException
Code where it fails:
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSString *creationTimeString = [dateFormatter stringFromDate:connection.creationTime]; _onClientConnected(@{ @"connectionId": connection.connectionId, @"creationTime": creationTimeString, @"data": connection.data, });
Would you happen to know where this error comes from?
cc @mike866
Thank you for your prompt effort @grabbou
Here is a complete log:
2017-01-06 10:53:00.259665 OpenTokVideoCall[602:109723] [DYMTLInitPlatform] platform initialization successful
2017-01-06 10:53:01.073 [info][tid:main][RCTBatchedBridge.m:72] Initializing <RCTBatchedBridge: 0x174195610> (parent: <RCTBridge: 0x1700a39c0>, executor: RCTJSCExecutor)
2017-01-06 10:53:01.081767 OpenTokVideoCall[602:109617] Initializing <RCTBatchedBridge: 0x174195610> (parent: <RCTBridge: 0x1700a39c0>, executor: RCTJSCExecutor)
2017-01-06 10:53:01.335924 OpenTokVideoCall[602:109711] [] __nw_connection_get_connected_socket_block_invoke 2 Connection has no connected handler
2017-01-06 10:53:01.438718 OpenTokVideoCall[602:109711] [] __nw_connection_get_connected_socket_block_invoke 3 Connection has no connected handler
2017-01-06 10:53:01.450 [warn][tid:main][RCTEventEmitter.m:54] Sending websocketFailed with no listeners registered.
2017-01-06 10:53:01.450279 OpenTokVideoCall[602:109617] Sending websocketFailed with no listeners registered.
2017-01-06 10:53:01.534 [info][tid:main][RCTRootView.m:249] Running application OpenTokVideoCall ({
initialProps = {
};
rootTag = 1;
})
2017-01-06 10:53:01.534670 OpenTokVideoCall[602:109617] Running application OpenTokVideoCall ({
initialProps = {
};
rootTag = 1;
})
2017-01-06 10:53:01.537 [info][tid:com.facebook.react.JavaScript] Running application "OpenTokVideoCall" with appParams: {"rootTag":1,"initialProps":{}}. DEV === true, development-level warning are ON, performance optimizations are OFF
2017-01-06 10:53:01.537481 OpenTokVideoCall[602:109755] Running application "OpenTokVideoCall" with appParams: {"rootTag":1,"initialProps":{}}. DEV === true, development-level warning are ON, performance optimizations are OFF
2017-01-06 10:53:01.606860 OpenTokVideoCall[602:109617]
2017-01-06 10:53:01.606967 OpenTokVideoCall[602:109617] ------------------------------------------------ 2017-01-06 10:53:01.606993 OpenTokVideoCall[602:109617] OpenTok iOS Library, Rev.2 2017-01-06 10:53:01.607097 OpenTokVideoCall[602:109617] This build was born on Dec 14 2016 at 00:05:04 2017-01-06 10:53:01.611458 OpenTokVideoCall[602:109617] Version: 2.10.0.2048-ios 2017-01-06 10:53:01.611651 OpenTokVideoCall[602:109617] libOpenTokObjC:bae8e89a775fce595738f5f45229f88e0b21a6b6 2017-01-06 10:53:01.611726 OpenTokVideoCall[602:109617] libOTKit:19888d7e0ab22a2790fb7806a75e45277d03fe74 2017-01-06 10:53:01.611777 OpenTokVideoCall[602:109617] WebRTC:ca7fe7ea0257ae5e4318549abbe7c0f79063865e 2017-01-06 10:53:01.611805 OpenTokVideoCall[602:109617] Copyright 2016 TokBox, Inc. 2017-01-06 10:53:01.611829 OpenTokVideoCall[602:109617] Licensed under the Apache License, Version 2.0 2017-01-06 10:53:01.611852 OpenTokVideoCall[602:109617] ------------------------------------------------ 2017-01-06 10:53:03.557667 OpenTokVideoCall[602:109711] [] __nw_connection_get_connected_socket_block_invoke 4 Connection has no connected handler 2017-01-06 10:53:04.105148 OpenTokVideoCall[602:109617] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2017-01-06 10:53:04.112570 OpenTokVideoCall[602:109617] [MC] Reading from public effective user settings. 2017-01-06 10:53:05.763094 OpenTokVideoCall[602:109710] [] __nw_connection_get_connected_socket_block_invoke 5 Connection has no connected handler 2017-01-06 10:53:07.970284 OpenTokVideoCall[602:109757] [] __nw_connection_get_connected_socket_block_invoke 6 Connection has no connected handler 2017-01-06 10:53:10.172535 OpenTokVideoCall[602:109711] [] __nw_connection_get_connected_socket_block_invoke 7 Connection has no connected handler 2017-01-06 10:53:12.376203 OpenTokVideoCall[602:109710] [] __nw_connection_get_connected_socket_block_invoke 8 Connection has no connected handler 2017-01-06 10:53:13.877859 OpenTokVideoCall[602:109617] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]' *** First throw call stack: (0x191b9d1b8 0x1905d455c 0x191a80eac 0x191a80d1c 0x1001bb6ac 0x1001d028c 0x1010d9258 0x1010d9218 0x1010de280 0x191b4a810 0x191b483fc 0x191a762b8 0x19352a198 0x197abd7fc 0x197ab8534 0x1000c7168 0x190a595b8) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
@rickcha Try to disable Debugging option
Hi @rickcha , did you solve your problem? Is there a reason to not to use react-native-opentok?
My app don't crash but the Subscriber freeze with some seconds of use... How can i disable the debug option?
In RCTOpenTokPublisherView.m, remove the connection.data property and pass only connection.connectionId and creationTimeString to _onClientConnected() within the connectionCreated() method. I noticed that trying to log connection.data didn't return anything, and so I suspect that might be causing the crash upon subscriber connect:
// RCTOpenTokPublisherView.m
...
/**
* Called when another client connects to the session
*/
- (void)session:(OTSession *)session connectionCreated:(OTConnection *)connection
{
/* ...date formatting code goes here... */
_onClientConnected(@{
@"connectionId": connection.connectionId,
@"creationTime": creationTimeString,
});
}
Hey!
Thanks for your feedback. We rewrote the library completely, which results in API changes and many bug fixes. If the issue still persists on the latest version, please re-open it.
Thanks!