react-native-fabric: Instantly crashes on Android

I’ve done all the installation steps, including installing Crashlytics manually as both Android and iOS, setting API key, etc. Then I installed this package to access things via JS.

On iOS this all worked.

On Android, it crashes immediately if the package is included. I’m not even calling any of the API functions. The following code:

var Fabric = require('react-native-fabric');
var { Crashlytics } = Fabric;

Immediately causes the following RN red error screen:

undefined is not an object (evaluating SMXCrahslytics.crash)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 20 (7 by maintainers)

Most upvoted comments

And finally I realize what’s going on with this last part. I wish this was more well-documented.

You have to run in release mode (https://facebook.github.io/react-native/docs/signed-apk-android.html, needs a keystore too) to actually send the crash reports to crashlytics.

Usually I find this happens when the linking process hasn’t worked. Check your MainApplication for:

@Override
    protected List<ReactPackage> getPackages() {
      reactCBLiteManager = new ReactCBLiteManager();

      return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new FabricPackage(), <- this line
      );
    }

  @Override
  public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics()); <- this line
  }