您可以直接在 Android Studio 中查看 Firebase Crashlytics 和 Android Vitals 的應用程式當機資料,並採取相應行動。有了這項整合功能,系統會從 Crashlytics 和 Google Play 提取堆疊追蹤資料和當機統計資料,並顯示在 Studio IDE 中的「App Quality Insights」工具視窗中,您就不必在瀏覽器和 IDE 之間來回切換。開發團隊也可受益於下列重要功能:
程式碼行若有 Crashlytics 事件資料,系統會醒目顯示。
提供重大當機事件的堆疊追蹤,使用者只要予以點選便能直接跳到相關的程式碼行。
顯示重大當機事件和不嚴重事件的摘要統計資料,例如依照裝置製造商和 Android 版本分組顯示。
可依據嚴重程度、時間和應用程式版本等屬性篩選事件。
系統會提供 Crashlytics 資訊主頁的瀏覽器連結,可供查看事件詳情。
取得洞察資料,協助您更輕鬆地瞭解並解決特定問題的根本原因。
所有在 Google Play 發布的應用程式都能使用 Android Vitals 報表。如果您尚未開始使用 Crashlytics,並且想深入瞭解 Crashlytics 提供的功能,請參閱 Firebase Crashlytics。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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."]]