Firebase crashlytics doesnt show crashes

Meera Potdar picture Meera Potdar · Jan 2, 2019 · Viewed 11.9k times · Source

Wanted to get a crash report from firebase once the app gets crashed. Is it possible to get debug mode logs separate and production crash log separate in firebase crash?...because its not really clear when we get crash from production or debug test. Also, firebase won't reflect crash report on the console after a crash happens. What should I do to get up to date crash report? Is there another way to get a crash report other than firebase? I have updated the libraries which required for the firebase crashlytics. and Followed tutorial - https://firebase.google.com/docs/crashlytics/get-started#android

Answer

Dennis Alund picture Dennis Alund · Jan 2, 2019

Is it possible to get debug mode logs separate and production crash log separate in firebase crash?

It's common practice or perhaps even recommended that you create a separate project for testing and production. Download and place the google-services.json in your build flavor folder

  • ~/app/src/release/google-services.json
  • ~/app/src/debug/google-services.json

Even if you are only having a single Firebase project for test and production, you can filter your logs by the application id if you're setting up a project id suffix for the development build flavor:

~/app/build.gradle

buildTypes {
  release {
  }
  debug {
    applicationIdSuffix '.debug'
    versionNameSuffix '-dbg'
  }
}

Here you can see the different flavors being available in Crashlytics

enter image description here

Also, firebase won't reflect crash report on the console after a crash happens.

First time that you set up crashlytics it might take some time before the data shows up in the dashboard. But if it's been over 24 hours, it's likely that it's not properly set up. Try to explicitly trigger a crash to make sure that it works fine.

Button crashButton = new Button(this);
crashButton.setText("Crash!");
crashButton.setOnClickListener(new View.OnClickListener() {
    public void onClick(View view) {
        Crashlytics.getInstance().crash(); // Force a crash
    }
});

Is there another way to get a crash report other than firebase?

Yes you can have more than one crash reporting tool if you have the need. You can perhaps create a wrapper class for crash reporting where you abstract the call to Crashlytics and you can add or change the underlying reporting platform there.