您可以直接在 Android Studio 中查看 Firebase Crashlytics 和 Android Vitals 提供的应用崩溃数据并采取措施。这项集成功能会将堆栈轨迹数据和崩溃统计信息从 Crashlytics 和 Google Play 提取到 Studio IDE 中的 App Quality Insights 工具窗口内,因此您无需在浏览器和 IDE 之间来回切换。开发团队可以受益于多项关键功能,包括:
在代码行有相关的 Crashlytics 事件数据时,查看突出显示的代码行。
查看主要崩溃的堆栈轨迹,然后点击堆栈轨迹以跳转到代码中的相关行。
查看有关主要崩溃和非严重事件的摘要统计信息,例如按设备制造商和 Android 版本分组的信息。
按严重性、时间和应用版本等属性过滤事件。
获取一个浏览器链接,用于打开 Crashlytics 信息中心,其中包含有关该事件的更多详细信息。
获取有助于您更轻松地了解和解决某些问题的根本原因的数据分析。
Android Vitals 报告适用于发布到 Google Play 的所有应用。如果您尚未使用 Crashlytics,但想要详细了解其功能,请参阅 Firebase Crashlytics。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Analyze issues from Firebase Crashlytics and Android Vitals with App Quality Insights\n\n| **Note:** App Quality Insights is only available in the current stable channel version of Android Studio, the three most recent previous major versions, and patches associated with those versions. If you are using an older version of Android Studio, you will need to update to use App Quality Insights. [More\n| information](/studio/releases#service-compat).\n\nYou can see and act on app crash data from\n[Firebase Crashlytics](https://firebase.google.com/products/crashlytics) and\n[Android Vitals](/topic/performance/vitals)\ndirectly in Android Studio. This integration pulls stack trace data and crash\nstatistics from Crashlytics and Google Play into the **App Quality Insights**\ntool window in the Studio IDE, so you don't have to jump back and forth between\nyour browser and the IDE. Development teams can benefit from key capabilities\nincluding the following:\n\n- See lines in your code highlighted when they have related Crashlytics event data.\n- See the stack trace for top crashes and click on the stack trace to jump to the relevant lines in your code.\n- See summary statistics about top crash and non-fatal events, for example grouped by device manufacturer and Android version.\n- Filter events by attributes including severity, time, and app version.\n- Get a browser link that opens the Crashlytics dashboard page with more details about the event.\n- Get insights that help you more easily understand and resolve root causes of certain issues.\n\nAndroid Vitals reports are available to all apps published to Google Play. If\nyou're not using Crashlytics yet and would like to learn more about its\nofferings, see\n[Firebase Crashlytics](https://firebase.google.com/products/crashlytics).\n\nGet started\n-----------\n\nTo see Crashlytics data in Android Studio, you need to set up Firebase and\nCrashlytics in your app project. Here's how: open the Firebase Assistant in\nAndroid Studio by going to **Tools \\\u003e Firebase** , click **Crashlytics** , and then\nfollow the tutorial to add Firebase and Crashlytics to your project. You can\nread more about the Firebase Assistant workflow in\n[Firebase's getting started guide for Android](https://firebase.google.com/docs/android/setup#assistant).\n\nIf you've already added Firebase and Crashlytics to your app, sign in to your\nDeveloper account in the IDE by clicking on the avatar icon\n.\nAfter you sign in, click the **App Quality Insights** tool window\n. You should\nsee the panels populate with reports from Crashlytics.\n\nAnalyze Android vitals\n----------------------\n\n**App Quality Insights** includes [Android vitals](/topic/performance/vitals)\ndata. This lets you more easily access core metrics collected by Google Play and\nimprove your user experience. Use Android vitals to address issues related to\napp stability to help improve the quality of your app on Google Play.\n\nYou can view Android vitals issues, filter them, and jump from stack trace to\ncode all from the **App Quality Insights** tool window. To get started, follow\nthese steps:\n\n1. Sign in to your developer account in Android Studio using the profile icon at the end of the toolbar.\n2. Open **App Quality Insights** by clicking the tool window in Android Studio or clicking **View \\\u003e Tool Windows \\\u003e App Quality Insights**.\n3. Click the **Android vitals** tab within **App Quality Insights**.\n4. Optional: To use version control integration for a debuggable build, add the\n latest\n [Firebase Crashlytics SDK](https://firebase.google.com/docs/crashlytics/get-started?platform=android#add-sdk)\n (or Firebase Android Bill of Materials) to your app. Then add the following\n code to the module-level `build.gradle.kts` or `build.gradle` file. Release\n (non-debuggable) builds have the flag enabled by default.\n\n | **Note:** App Quality Insights only supports version control using git.\n\n\u003cbr /\u003e\n\n### Kotlin\n\n```kotlin\nandroid {\n buildTypes {\n getByName(\"debug\") {\n vcsInfo {\n include = true\n }\n }\n }\n}\n```\n\n### Groovy\n\n```groovy\nandroid {\n buildTypes {\n debug {\n vcsInfo {\n include true\n }\n }\n }\n}\n```\n\n\u003cbr /\u003e\n\nAnalyze Crashlytics data in Android Studio\n------------------------------------------\n\nThe **App Quality Insights** tool window has rich data that gives you insight\ninto the events your users are encountering, and links to help you quickly\nnavigate to the sources of those events.\n\n1. 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.\n2. The **Issues** panel shows the top events that Crashlytics has data for, and is sorted by your most impactful crashes.\n3. View events by *variants*, or groups of events that have similar stack traces. Analyzing events by variant helps you identify the root causes of a crash.\n4. The **Stack trace** tab shows details about the latest\n occurrence of the event you click in the **Issues** panel. You can see the\n event's stack trace and click the stack trace to jump to the relevant lines in\n your codebase. If your code has changed since the crash occurred, click\n **show diff** next to the error in the stack trace to view a diff between\n your current code and the version of your codebase that generated the crash.\n\n There is also information about the device type affected, its Android\n version, and the time the event occurred, as well a link to the event in the\n Firebase Crashlytics dashboard. To browse info for multiple events in a group,\n use the left and right arrows. Click **Close issue** to close an issue\n directly from the panel.\n5. The **Keys** and **Logs** tabs show custom key-value pairs and logs for each Crashlytics report.\n6. 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 versions experienced the crash and the number of users affected.\n7. Read and attach notes to issues so that they are visible in the Firebase Console and your teammates. To write a note about an issue, select the issue and open the **Notes** panel. You must have write permission to the Crashlytics project in order to write notes. Issues with notes appear with a \"notes\" icon in the **Issues** panel.\n8. Use the variety of filters to hone in on certain subsets of events. You can select or deselect events that are Fatal , Non-Fatal , and [ANRs](/topic/performance/anrs/keep-your-app-responsive) , as well as filter by time, app version, [Crashlytics Signal](https://firebase.google.com/support/releases#october_8_2021), device make and model, and Android platform version. Note that for the Crashlytics Signal states, an issue is considered *regressed* when it's been closed in the past and has occurred again in a new version of the app.\n\nIn addition to being able to navigate from stack trace to code, you can also\njump from code to stack trace: Android Studio now annotates lines of code that\nare related to crashes with a crash gutter icon\nso you\ncan easily spot and debug them.\n\nWhen you hover over the crash icon, a pop-up appears that shows how many events\ninvolve that line of code, and the event frequencies.\n\nClick on the crash icon for a more detailed list of events, including the\nfrequency of and number of users affected by a given event. Click on a specific\nevent to jump to the event details in the **App Quality Insights** tool window.\n\n### Different numbers between Android vitals and Crashlytics\n\nNote that Android vitals and Crashlytics might report different values for the\nnumbers of users and events associated with the same crash. These discrepancies\nhappen because Play and Crashlytics can catch crashes at different times and for\ndifferent users. Here are a couple reasons for why the Play and Crashlytics\ncounts might differ:\n\n- Play catches crashes starting at boot time, whereas Crashlytics catches crashes that happen after the Crashlytics SDK initializes.\n- If a user opts out of crash reporting when they get a new phone, those crashes aren't reported to Play; however, Crashlytics catches crashes based on an app's own privacy policy.\n\nInvestigate with limited functionality when offline\n---------------------------------------------------\n\nIf you make a new request, for example by clicking **Refresh** , and Android\nStudio is unable to communicate with Crashlytics, the **App Quality Insights**\nwindow lets you to enter **Offline Mode**.\n\nWhile in this mode, you can continue to investigate issues and the latest events\nfrom cached data. Certain functionality, such as changing some filter options or\nclosing issues, isn't available. To retry your connection to Crashlytics\nand return to an online state, click **Reconnect**\n."]]