You can see and act on app crash data from Firebase Crashlytics directly in Android Studio. This integration pulls stack trace data and crash statistics from Crashlytics into the App Quality Insights tool window in the Studio IDE, so you don't have to jump back and forth between your browser and the Studio IDE. Development teams can benefit from key capabilities including the following:
- See lines in your code highlighted when they have related Crashlytics event data.
- See the stack trace for top crashes and click on the stack trace to jump to the relevant lines in your code.
- See summary statistics about top crash and non-fatal events, for example grouped by device manufacturer and Android version.
- Filter events by severity, time, and app version.
- Get a browser link that opens the Crashlytics dashboard page with more details about the event.
If you're not using Crashlytics yet and would like to learn more about its offerings, see Firebase Crashlytics.
To see Crashlytics data in Android Studio, you need to set up Firebase and Crashlytics in your app project. Here's how: open the Firebase Assistant in Android Studio by going to Tools > Firebase, click Crashlytics, and then follow the tutorial to add Firebase and Crashlytics to your project. You can read more about the Firebase Assistant workflow in Firebase's getting started guide for Android.
If you've already added Firebase and Crashlytics to your app, sign in to your Developer account in the IDE by clicking on the avatar icon . After you sign in, click on the App Quality Insights tool window. You should see the Issues, Sample Stack Trace, and Details panels populate with reports from Crashlytics.
Navigate Crashlytics data in Android Studio
The App Quality Insights tool window has rich data that gives you insight into the events your users are encountering, and links to help you quickly navigate to the sources of those events.
- If your project includes multiple app modules, make sure the module you want to see event data for is selected from the module dropdown menu.
- Use the application ID dropdown menu to select the app ID you want to analyze. For example, while you might work on the debug version of your app in the IDE, you might want to see event data for your production version of your app that your users install.
- The Issues panel shows the top events that Crashlytics has data for, and is sorted by your most impactful crashes.
The Sample Stack Trace panel shows details about the latest occurrence of the event you click on in the Issues panel. You can see the event's stack trace and click on the stack trace to jump to the relevant lines in your code base.
There is also information about the device type affected, its Android version, and the time the event occurred, as well a link to the event in the Firebase Crashlytics dashboard. The dashboard is useful if you want to dive deeper and inspect additional stack traces, trends, and custom logs.
- The Details panel breaks down the crash counts by device type and Android version, so you can determine which user groups are most affected. It also shows which app version(s) experienced the crash and the number of users affected.
- Use the severity filters to select or deselect events that are Fatal or Non-Fatal .
- Use the time range and app version filters to hone in on certain subsets of events.
In addition to being able to navigate from stack trace to code, you can also jump from code to stack trace: Android Studio now annotates lines of code that are related to crashes with a crash gutter icon so you can easily spot and debug them.
When you hover over the crash icon, a pop-up appears that shows how many events involve that line of code, and the event frequencies.
Click on the crash icon for a more detailed list of events, including the frequency of and number of users affected by a given event. Click on a specific event to jump to the event details in the App Quality Insights tool window.