react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

[iOS] crashlytics.createCustomError 'additional' property throwing error

Open cjpete opened this issue 7 years ago • 14 comments

Issue

Describe your issue here

When using firebase.crashlytics().recordCustomError, it throws an exception when trying to pass 'additional' data on iOS:

    const stack: RNFirebase.crashlytics.customError[] = [
      {
        fileName: "fileName",
        functionName: "functionName",
        lineNumber: 1,
        additional: {
          bla: "bla"
        }
      }
    ];
    firebase.crashlytics().recordCustomError(errorName, errorDescription, stack);

image


Project Files

iOS

Click To Expand

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:
pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTBlob',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
  ]

  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_unimodules!

  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
  pod 'RNSVG', :path => '../node_modules/react-native-svg'
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  pod 'react-native-webview', :path => '../node_modules/react-native-webview'
  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
  pod 'react-native-orientation', :path => '../node_modules/react-native-orientation'
  pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
  pod 'RNScreens', :path => '../node_modules/react-native-screens'

  pod 'Firebase/Core', '~> 5.20.1'
  pod 'Firebase/Messaging', '~> 5.20.1'

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • [ ] my application is an AndroidX application?
  • [ ] I am using android/gradle.settings jetifier=true for Android compatibility?
  • [ ] I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
      Memory: 6.59 GB / 32.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 11.14.0 - ~/.nvm/versions/node/v11.14.0/bin/node
      Yarn: 1.15.2 - ~/.nvm/versions/node/v11.14.0/bin/yarn
      npm: 6.7.0 - ~/.nvm/versions/node/v11.14.0/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 23, 26, 27, 28, 29
        Build Tools: 27.0.3, 28.0.2, 28.0.3
        System Images: android-22 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.9 => 0.59.9 
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1
  • Platform that you're experiencing the issue on:
    • [x] iOS
    • [ ] Android
    • [ ] iOS but have not tested behavior on Android
    • [ ] Android but have not tested behavior on iOS
    • [ ] Both
  • react-native-firebase version you're using that has this issue:
    • e.g. 5.4.3
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • Y/N


Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]

cjpete avatar Jul 10 '19 14:07 cjpete

Glad I found this, I am having the same issue. By removing the additional data and shoving it into crashlytics keys, I was able to get around the crash that this causes.

dan-coulter avatar Jul 27 '19 00:07 dan-coulter

My current workaround:

let additional = {
  bla: 'bla'
};
if (Platform.OS === 'ios') {
  // object literal will crash on iOS, so transform to string
  additional = JSON.stringify(additional, null, 2);
}
firebase.crashlytics().recordCustomError(errorName errorDescription, [
  {
    fileName: 'fileName',
    functionName: 'functionName',
    lineNumber: 1,
    additional,
  },
]);

yosimasu avatar Aug 22 '19 08:08 yosimasu

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 19 '19 09:09 stale[bot]

I am having same issue. Do you have any solution for this?

ltanhswd avatar Sep 24 '19 08:09 ltanhswd

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 22 '19 09:10 stale[bot]

Sounds like many people are having this issue, so closing due to being stale probably not great!

cjpete avatar Oct 22 '19 09:10 cjpete

@cjpete this is recorded against rn 0.59.x and rnfb v5.4.x with pods 5.20.x - in the intervening time rnfb v5.5.6 is out with pods up to 6.10 (and working with rnfb5.5.6). I don't think upgrading react-native matters in this case but the rnfb and pods versions could be really important. Can you reproduce it on rnfb556 and pods6.10 ?

mikehardy avatar Oct 22 '19 11:10 mikehardy

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 19 '19 12:11 stale[bot]

ExceptionsManager.js:126 Exception '-[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0xdffd969fdde9ee9a' was thrown while invoking recordCustomError on target RNFirebaseCrashlytics with params ( "name", "message", ( { additional = test; className = test; fileName = "test.js"; functionName = test; } ) ) callstack: ( 0 CoreFoundation 0x000000019cca7ac4 046F17DF-03A8-3D03-99F5-BD4CFF8123C4 + 1256132 1 libobjc.A.dylib 0x000000019c9c1028 objc_exception_throw + 60 2 CoreFoundation 0x000000019cba5f10 046F17DF-03A8-3D03-99F5-BD4CFF8123C4 + 200464 3 CoreFoundation 0x000000019ccac254 046F17DF-03A8-3D03-99F5-BD4CFF8123C4 + 1274452 4 CoreFoundation 0x000000019ccae3f0 _CF_forwarding_prep_0 + 96 5 airbase 0x00000001047bd380 -[RNFirebaseCrashlytics recordCustomError:reason:frameArray:] + 1104 6 CoreFoundation 0x000000019ccae5a4 046F17DF-03A8-3D03-99F5-BD4CFF8123C4 + 1283492 7 CoreFoundation 0x000000019cb771d0 046F17DF-03A8-3D03-99F5-BD4CFF8123C4 + 8656 8 CoreFoundation 0x000000019cb77de0 046F17DF-03A8-3D03-99F5-BD4CFF8123C4 + 11744 9 airbase 0x00000001048d63d8 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1896 10 airbase 0x00000001048d9dd4 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660 11 airbase 0x00000001048d9948 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144 12 airbase 0x00000001048d98ac ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28 13 libdispatch.dylib 0x0000000106141e1c _dispatch_call_block_and_release + 32 14 libdispatch.dylib 0x000000010614327c _dispatch_client_callout + 20 15 libdispatch.dylib 0x000000010614a90c _dispatch_lane_serial_drain + 720 16 libdispatch.dylib 0x000000010614b4fc _dispatch_lane_invoke + 408 17 libdispatch.dylib 0x00000001061564dc _dispatch_workloop_worker_thread + 1344 18 libsystem_pthread.dylib 0x000000019c9b3a94 _pthread_wqthread + 280 19 libsystem_pthread.dylib 0x000000019c9b9c7c start_wqthread + 8 )

The app crashes with this error. Is there any update on this?

"react-native-firebase": "^5.5.6"

ghost avatar Dec 04 '19 12:12 ghost

I've got the same crash

sattaman avatar Dec 06 '19 08:12 sattaman

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 03 '20 09:01 stale[bot]

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

stale[bot] avatar Jan 19 '20 00:01 stale[bot]

Also having this issue

dansiemens avatar Feb 21 '20 18:02 dansiemens

Having same issue. Upgraded project to RN 62

vijaya-iprogrammer avatar Jun 29 '20 11:06 vijaya-iprogrammer