Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native ios application crash if remote debug is not enabled

Using react-native. If i turn off "Debug js Remotely" the app crash and system logs errors that i cannot understand.

I open system log inside ios simulator and it log following

ivf[95067]: [] nw_connection_get_connected_socket_block_invoke 44 Connection has no connected handler
com.apple.CoreSimulator.SimDevice.73F03ED5-12AF-41DD-9108-349E09982B56.launchd_sim[76806] (UIKitApplication:com.simplein.ivf[0x8918][76828][95067]): Service exited due to Segmentation fault: 11
SpringBoard[76823]: UNSUserNotificationServerConnectionListener connection invalidated
 backboardd[76824]: [Common] Unable to get short BSD proc info for 95067: No such process
backboardd[76824]: [Common] Unable to get proc info for 95067: Undefined error: 0
SpringBoard[76823]: [KeyboardArbiter] HW kbd: Failed to set (null) as keyboard focus
assertiond[76828]: Deleted job with label: UIKitApplication:com.simplein.ivf[0x8918][76828]

I have no clue in ios developement, but the app crash once i try to render a screen that has an InputText and few other Views.

Strange is if i enable Debug Js Remotely it will work just fine and will not even log any errors.

like image 326
Zalaboza Avatar asked Aug 03 '17 06:08

Zalaboza


1 Answers

in this case, problem was that console.log was logging a huge objects, for some reason this is fine when running in debug mode cause react-native in debug use v8 of chrome even on ios, while on phone it will use different engine.

so as it seems, recommendation for not logging huge objects with multiple inheritance (i was logging this of a nested component which had props, navigation, redux store, etc all attached) is important in production. don't leave your console.log in code to avoid such crashs.

like image 99
Zalaboza Avatar answered Oct 09 '22 20:10

Zalaboza