React-native-firebase: iOS: crashytics.recordError() not showing in crash report dashboard in firebase

Created on 26 Jul 2020  路  8Comments  路  Source: invertase/react-native-firebase

Hi,

I am using these packages:
"@react-native-firebase/analytics": "^7.3.1",
"@react-native-firebase/app": "^8.2.0",
"@react-native-firebase/crashlytics": "^8.1.2",

When I am crashing by throwing the exception from react-native JS module, crashlytics().recordError(error) does't showing the crash report in dashboard.
However crashlytics.crash() is showing the errors in dashboard.

I tried both debug and release mode.

Any help would be much appreciated.

Most helpful comment

I checked and tried enabling the auto collection but didn't work out.
crashlytics.crash() is getting recored in firebase console but not the crashlytics.recordError();

All 8 comments

Are you sure you aren't filtering for crashes only? It's the default in the console, to have it filtered for crashes only. You have to unfilter the reports in order to see the non-fatal ones logged by recordError

I removed all the filter, still I didn't see the the error.
This is how I am capturing the error.

const defaultHandler = global.ErrorUtils.getGlobalHandler();
global.ErrorUtils.setGlobalHandler((...args) => {
const error = args[0] || 'Unknown';
if (error instanceof Error) {
crashlytics().setAttribute('stack', ${error.stack.toString()});
crashlytics().setAttribute('message', ${error.message});
crashlytics().recordError(RN Fatal: ${error});
} else {
// crashlytics.recordError(RN Fatal: ${error})
}

defaultHandler.apply(this, args);
});

You mean, you are doing roughly what the module would do for you automatically?

https://github.com/invertase/react-native-firebase/blob/e7b4bb31b05985c044b1f01625a43e364bb653ef/packages/crashlytics/lib/index.js#L42-L43

https://github.com/invertase/react-native-firebase/blob/e7b4bb31b05985c044b1f01625a43e364bb653ef/packages/crashlytics/lib/handlers.js#L53-L97

...because I get global error handling for free just from installing the module, and it does work

Are you certain you have collection configured correctly? It is a little non-intuitive at the moment #3879

Even after removing the GlobalErrorHandler from my code, I don't see crashes or non-fatal error in firebase console dashboard.

This is code I am triggering on Button click to record the error in crashlytics.

function testCrash() {
throw new Error('Test error');
}

Is it correct?

Hi Mike,

I tried all the possible steps and still no luck.
Is there any known issue in recent version of @react-native-firebase/crashlytics?

I checked and tried enabling the auto collection but didn't work out.
crashlytics.crash() is getting recored in firebase console but not the crashlytics.recordError();

We believe this is resolved, our effort was focused on this thread: https://github.com/invertase/react-native-firebase/issues/3879#issuecomment-678389795 - we will reopen there if it continues

Was this page helpful?
0 / 5 - 0 ratings