react-native-fabric: undefined is not a function (evaluating SMXCrashlytics.recordError(newError))

Trying to integrate react-native-fabric in an Android project I’m working on and this came up. I’m using react-native v0.22.2 and react-native-fabricv0.1.0and followed Fabric’s instruction to get Crashlytics running in the app and my project now shows up on the dashboard of my Fabric account.

screen shot 2016-04-11 at 9 49 30 am

Seems to point to Line 52 in Crashlytics.js, which just calls SMXCrashlytics.recordError(newError);

I added a console.log to take a look at SMXCrashlytics in chrome and got this:

screen shot 2016-04-11 at 9 51 04 am

All the other functions appear to be there. Is there something I’m missing? Any help would be appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 10
  • Comments: 29 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Can we adjust the API so it’s the same for android and iOS. It seems that having Crashlytics.logException for Android and Crashlytics.recordError is confusing for users.

Had same issue with SMXCrashlytics.crash method, reason was that rnpm didn’t add new FabricPackage() to list in MainApplication.getPackages() method. You can check everything here https://github.com/corymsmith/react-native-fabric#without-rnpm.

Mainly just been busy, will try to get a release out today

I’ll have a look at this today

I’ve had the same issue. But then I realized that I was doing npm install react-native-fabric and rnpm install react-native-fabric.

What I did: npm install react-native-fabric and rnpm link react-native-fabric (note link instead of install) and then rebuild and run the project.

This solved the problem