Razz Rathod
Razz Rathod

Reputation: 11

i can't see crash report of android in firebase console

1) I implement firebase crashlytics in my react native project.

2) I used below npm

3) I can do crash app by programmatically using

async forceCrash() {

       firebase.crashlytics().crash();

       await firebase.crashlytics().setAttributes({ something: 
             "something" });

       firebase.crashlytics().log("A woopsie is incoming :(");

       firebase.crashlytics().recordError(new Error("Error Log"));

}

Upvotes: 1

Views: 1302

Answers (1)

Chintan
Chintan

Reputation: 671

React native is not officially supported but developers have been able to use crashlytics with React native. From your snippet of code, it seems that you are try trying make a test crash and send a non-fatal exception at the same time.

If you want to see logs on your crash report, the code should look something like this:

Crashlytics.log("Crash occurred! Bailing out...");

Make sure that you set these logs before your app crashes.

If you want to send non-fatal exception:

try {
        throw new NullPointerException("It is Pointer No-Fatal Error");

    } catch (Exception e) {

        Crashlytics.logException(e);

        // handle your exception here!
    }

Logs will also appear with non-fatal exceptions as long as they were set before the exception occurs.

Upvotes: 1

Related Questions