Crashlytics class not recognized with Firebase Crashlytics SDK

Viewed 1050

With the Firebase Crashlytics SDK, the documentation explains how you can force a crash

However, in the line:

Crashlytics.getInstance().crash();

Crashlytics is unrecognized and cannot be imported.

I tried switching to FirebaseCrashlytics.getInstance() but there is no crash() method.

Note: Crashlytics is indeed set up properly - I am able to cause my own crash by looking up a view that does not exist and it is reported correctly.

1 Answers

We have deprecated the force crash method in the new SDK. One example of a way to force a crash is manually throwing an exception

throw new RuntimeException("This is a crash");
Related