negativetwelve / react-native-ux-cam

React Native wrapper for uxcam.com
53 stars 36 forks source link

Crashing when calling startWithKey on iPhone 7 #108

Closed rtanizawa-feedcast closed 3 years ago

rtanizawa-feedcast commented 5 years ago

Hi, I'm having an issue that my app crashes when running UXCam.

I can't reproduce on the simulator, but when I download in my phone it crashes intermittently. Our index.js just have this (with the proper key):

  RNUxcam.startWithKey('<our_key>');
  RNUxcam.optIntoSchematicRecordings();

To reproduce just open the app, if doesn't crash, kill the app and open again.

And this is the stacktrace:

Exception '*** +[NSJSONSerialization dataWithJSONObject:eror:]: value parameter is nil was thrown while invoking startWithKey on target RNUxcam with params (
    <our_key>
)
callstack: (
    0   CoreFoundation                      0x00000001a72449a0 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 1227168
    1   libobjc.A.dylib                     0x00000001a6f6d0a4 objc_exception_throw + 56
    2   Foundation                          0x00000001a756316c 0DF2911E-80CB-3289-8A1E-ED0913D55A12 + 450924
    3   ourAppName                          0x0000000102e21280 -[UXCamHandler prepareVerifyRequestParametersWithInternalLogs:] + 1552
    4   ourAppName                          0x0000000102e21674 -[UXCamHandler validateSessionRequest] + 668
    5   ourAppName                          0x0000000102e20740 -[UXCamHandler startSession] + 232
    6   ourAppName                          0x0000000102e1f644 +[UXCamHandler start:buildidentifier:mutlipleSessions:completionblock:] + 352
    7   ourAppName                          0x0000000102e0bf44 +[UXCam startWithKey:buildidentifier:multipleSessions:completionblock:] + 232
    8   ourAppName                          0x0000000102e0be40 +[UXCam startWithKey:buildidentifier:completionBlock:] + 84
    9   ourAppName                          0x0000000102e0bdd8 +[UXCam startWithKey:buildidentifier:] + 64
    10  ourAppName                          0x0000000102adef08 -[RNUxcam startWithKey:] + 152
    11  CoreFoundation                      0x00000001a724ad90 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 1252752
    12  CoreFoundation                      0x00000001a711abd0 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 7120
    13  CoreFoundation                      0x00000001a711b7a8 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 10152
    14  ourAppName                          0x0000000102b8de84 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1896
    15  ourAppName                          0x0000000102b91880 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660
    16  ourAppName                          0x0000000102b913f4 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
    17  ourAppName                          0x0000000102b91358 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
    18  libdispatch.dylib                   0x00000001a6f11610 3A5DB4E0-BC24-375D-897E-51E6CF7D6304 + 374288
    19  libdispatch.dylib                   0x00000001a6f12184 3A5DB4E0-BC24-375D-897E-51E6CF7D6304 + 377220
    20  libdispatch.dylib                   0x00000001a6ec41d0 3A5DB4E0-BC24-375D-897E-51E6CF7D6304 + 57808
    21  CoreFoundation                      0x00000001a71c23c4 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 693188
    22  CoreFoundation                      0x00000001a71bd3b8 DA838E75-6B30-360E-9661-C4800A7E1BF6 + 672696
    23  CoreFoundation                      0x00000001a71bc8bc CFRunLoopRunSpecific + 464
    24  GraphicsServices                    0x00000001b1028328 GSEventRunModal + 104
    25  UIKitCore                           0x00000001ab2526d4 UIApplicationMain + 1936
    26  ourAppName                          0x00000001029309f0 main + 124
    27  libdyld.dylib                       0x00000001a7047460 E1637502-BFCB-3BBC-B3E1-CCF78617E0E4 + 5216
)
RCTFatal
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&)
facebook::react::rctnativemodule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::rctnativemodule::invoke(unsigned int, folly::dynamic&&, int)
3A5DB4E0-BC24-375D-897E-51E6CF7D6304
3A5DB4E0-BC24-375D-897E-51E6CF7D6304
3A5DB4E0-BC24-375D-897E-51E6CF7D6304
DA838E75-6B30-360E-9661-C4800A7E1BF6
DA838E75-6B30-360E-9661-C4800A7E1BF6
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
E1637502-BFCB-3BBC-B3E1-CCF78617E0E4
diegogoncalves commented 5 years ago

Same issue here, this is preventing me from using UXCam since it's crashing the app

richardgroves commented 5 years ago

Hi,

Sorry about the issues you are having. Could you try using the beta version of the UXCam plugin and see if that fixes the issue (it has an updated native library that should avoid this crash).

react-native unlink react-native-ux-cam
react-native link react-native-ux-cam@5.1.13-beta.2

If on react-native version >=0.60 also do: cd ios && pod update && cd ..

richardgroves commented 5 years ago

The final version 5.1.13 has now been published (but is unchanged in terms of code from the last beta).