Firebase Crashlytics

50% of one-star reviews in the Play Store has something to do with stability and bugs on the other hand 60% of five-star reviews make a mention of speed, design, or usability.So your end users really feel it when your experience is performant and is stable.Once you ship your app into the wild you have real users using your app, Firebase has tools such as Performance Monitoring and Crashlytics that allow you to understand the end user experience in production.

Firebase Crashlytics is now available to all Firebase developers.So if you’re an existing Firebase developer, you test out Crashlytics and upgrade.

Let’s talk a little bit about what that means for Crashlytics be available on Firebase.Because, as many of you know, Crashlytics is the market leader for crash reporting used by hundreds of thousands of developers their applications and installed in over 2.5 billion devices but what Firebase able to do now if bring Crashlytics into one unified console so it can truly work better together with all the other Firebase products.Firebase made sure to keep the install process amazingly simple.So whether you’re using Gradle on Android or CocoaPods on IOS, and you want to install the SDK manually, you can use you’re existing Google Services file and get up and running in a matter of minutes, just like any other Firebase SDK.

As a developer, you want to get the bottom of the crash and before using a crash reporting solution like Crashlytics, you actually know how to plug your phone into your Mac and find where they hide this crash report in Android Studio,you’re going to be looking at the stack trace.

 Firebase Crashlytics

What you really want is a crash reporting tool that can take that crash, along with all the other crashes that are happening in the wild, group them, prioritize them, give you an idea of how your app is doing stability-wise, release over release.


One great measure of that is looking at your crash-per-users statistic.So Firebase has a lot of customers who use this as a key performance indicator to know if their apps are getting more stable or less stable release over release and all these crashes prioritize them into issues and issues are ranked by the number of times they are occurring and the number of devices that they are occurring on.

Issues list

You can clearly see here the line of code that crashed, the file name, and even do things like call up interesting bits of information, like maybe this crash is only occurring on ios 11.So maybe that’s indicative of something changing in the latest release, maybe deprecated API that you’re not supposed to be using anymore.It lets you know that maybe this crash is only occurring on rooted or jailbroken devices.That could indicate that someone’s using your app in a way that you didn’t intend.So maybe you don’t want to fix this crash.Just a couple of quick things there to really help you know that just to get a better idea of what you’re going to be getting into in solving this crash.

Issues Detail

Now, diving even deeper, you’ll see that you get this Issue detail now you can see the full, now symbolicated or unobfuscated stack’ll see how the crash has been trending, version by version.You can see an operating system or device breakdown.
Realtime alerting emailThe console isn’t the only place you can find out about crashes.Firebase will alert you in real time, via email, the second a new issue arises.Firebase’ll let you know when a new issue arises not only new issues but also regressed issues.So if you close an issue, you think you’re all good and then we see that pop up on a new version, Firebase’ll let you know immediately about that.Velocity alerts are when one issue is causing a statistically significant portion of all sessions to crash.So this may indicate that you need to issue a hotfix right away or roll back because something really wrong is happening with your application and you get all this out of the box.This is with crash reporting.

Get started with Firebase Crashlytics

Firebase Crashlytics can work with the very little setup on your part—as soon as you add the SDK, Crashlytics gets to work sending crash reports to the Firebase console.

To get started with Firebase Crashlytics, you need an app with Firebase enabled.

  • Click Tools > Firebase to open the Assistant window.
  • Click to expand one of the listed features (for example, Analytics), then click the provided tutorial link (for example, Log an Analytics event).
  • Click the Connect to Firebase button to connect to Firebase and add the necessary code to your app.


 Enabled Firebase in android app

Add the Crashlytics SDK to your project

1.Add the Crashlytics repositories and dependency to your project-level build.gradle file:

2.Add the Crashlytics dependencies to your app-level build.gradle:

Customize your Firebase Crashlytics crash reports

For more fine-grained control of your crash reports, customize your Crashlytics SDK configuration. For example, you can add logs to track down pesky bugs, and more.

1.Retracing a user’s steps with logs

If I’m lucky, I may be able to look at the stack trace, see the line of code that crashed, and know exactly how to fix that.But If I don’t, I’m going to want to reproduce that crash.The great way to retrace a user’s steps is with custom logs.So from the issue Detail Page ,you can see the Logs tab and diving into that.

On Android, use Crashlytics.log to help pinpoint issues.

Crashlytics.log can write logs to a crash report and with Log.println(), or just to the next crash report:

  • Crash report and Log.println:

  • Crash report only:

Crashlytics limits logs to 64kB. Crashlytics deletes older log entries if a session’s logs go over that limit.

2.Finding Contextual cues with keys

Sometimes it’s not just about the order of operations that causes the crash.It’s actually the context that the user is in.You could imagine, maybe it’s the size of the file they have that they’re trying to upload maybe it’s how many items they have in their shopping cart, the level they are on a game.So here’s an example where I’m recording the key value.

Re-setting a key updates its value, for example:

Crashlytics supports a maximum of 64 key/value pairs. Once you reach this threshold, additional values are not saved. Each key/value pair can be up to 1 kB in size.

Log non-fatal exceptions

Crashlytics lets you log non-fatal exceptions.On Android, that means you can log caught exceptions in your app’s catch blocks:

All logged exceptions appear as non-fatal issues in the Firebase console. The issue summary contains all the state information you normally get from crashes, along with breakdowns by Android version and hardware device.

Crashlytics processes exceptions on a dedicated background thread, so the performance impact to your app is minimal. To reduce your users’ network traffic, Crashlytics batches logged exceptions together and sends them the next time the app launches.

Crashlytics only stores the most recent 8 exceptions in a given app session. If your app throws more than 8 exceptions in a session, older exceptions are lost.

Set user IDs

To diagnose an issue, it’s often helpful to know which of your users experienced a given crash. Crashlytics includes a way to anonymously identify users in your crash reports.

To add user IDs to your reports, assign each user a unique identifier in the form of an ID number, token, or hashed value:

If you need to clear a user identifier after you set it, reset the value to a blank string.

So these are a few tips with Crashlytics and how you can get the most out of crash reporting.

Related Post

Firebase Performance Monitoring for Android