Migrating Crashlytics to the Firebase Console

Last week I setup a project to use Crashlytics for Android as our crash reporting tool.
This week, at the Firebase Dev Summit, support was announced for Crashlytics issue reporting from within your existing Firebase console.
Since I prefer to use as few different service consoles as possible, I wanted to migrate over to the new Firebase Crashlytics reporting. It was a pretty straightforward process with a couple small gotchas, so I thought I would share what I found.
Starting Point
I started with an app that was configured to use Crashlytics and report to the Fabric console as described here.
To help demonstrate the migration process, I set up a sample project on GitHub.
This commit installs the Fabric/Crashlytics kit, and will send crash reports to the Fabric console when a button is clicked. At this point, the sample app works the same way as the app I had set up last week.
Enable Firebase
If you already have a Firebase enabled app, you can skip down to the next section.
Before you can start receiving crash reports within the Firebase console, you must have a Firebase enabled app. A more detailed overview of this process can be found here but I’ve included the basic steps below:
Start by clicking “Add another app”
Choose “Android”
Enter the package name of your app, and an alias if desired
Download the “google-services.json” file and add it to your app’s directory
Add the Firebase plugin to your app
Migrate to Firebase Console
Once you have a Firebase app created, you can migrate over to using Firebase for your crash reporting.
Using the Getting Started docs as a guide, I was able to migrate crash reports by doing the following:
- In build.gradle: update the Fabric plugin to version
1.24.4
- Add
maven { url "https://maven.google.com/" }
to build.gradle - To app/build.gradle add the Firebase sdk:
implementation "com.google.firebase:firebase-core:11.4.2"
The first small gotcha was that I then also had to update the google-services
plugin to version 3.1.2
.
At this point, I was able to deploy the app, but my crash reports were still not showing up in the firebase console.
The 2nd gotcha was that I seemingly needed to remove the api key meta-data from the app’s manifest.
Once I removed that and redeployed, the crash reports started coming through in the Firebase console. Hooray!
The full migration changes can be found in this commit.
I’m now happily using Crashlytics and collecting/analyzing crash reports from within our Firebase console.
Update 11/6/17
I wanted to clarify 1 point. Currently, when you switch to the Firebase console, you will not have any historical crash data. This is likely a large roadblock for established projects, and would be a strong reason to stay with the existing Fabric console.
In my case, I was dealing with a new project. We only had 1 week of historical data so we were able to make the transition.
Check out this response for more info: https://medium.com/@bonnell/fabric-and-firebaser-here-16ffb98b5afe