我在项目中添加了Firebase Crashlytics,并使用以下代码强制创建了崩溃。该崩溃已创建并登录到logcat中,但未出现在Crashlytics仪表板中!
我启用了调试日志记录到我的项目,在强制崩溃时看到了以下消息,但是我不知道这是什么/是什么问题?
我可以在Fabric控制台中看到我的错误,但它们不会在Firebase中显示。在Firebase中,过去30分钟内的类似用户的Analytics(分析)报告都可以与我的应用一起使用。我已经尝试了大约3天,但仍然无法在仪表板上看到错误!
我的代码:
Button crashBtn=findViewById(R.id.crashBtn);
crashBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Crashlytics.getInstance().crash();
}
});
使用adb启用调试日志记录后出现我的错误:
01-30 09:38:58.919 24986 24986 D CrashlyticsCore: Crashlytics is handling uncaught exception "java.lang.ArrayIndexOutOfBoundsException: length=2; index=10" from thread main
01-30 09:38:58.956 24986 25028 D CrashlyticsCore: No log data to include with this event.
01-30 09:38:59.121 24986 25028 D CrashlyticsCore: Closing open sessions.
01-30 09:38:59.121 24986 25028 D CrashlyticsCore: Closing session: 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.121 24986 25028 D CrashlyticsCore: Collecting session parts for ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.124 24986 25028 D CrashlyticsCore: Session 5C513E7B02FD-
0001-619A-AF0E1194ACF2 has fatal exception: true
01-30 09:38:59.127 24986 25028 D CrashlyticsCore: Session 5C513E7B02FD-0001-619A-AF0E1194ACF2 has non-fatal exceptions: false
01-30 09:38:59.129 24986 25028 D CrashlyticsCore: Collecting SessionStart data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.133 24986 25028 D CrashlyticsCore: Collecting SessionUser data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.137 24986 25028 D CrashlyticsCore: Collecting SessionApp data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.139 24986 25028 D CrashlyticsCore: Collecting SessionOS data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.140 24986 25028 D CrashlyticsCore: Collecting SessionDevice data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.143 24986 25028 D CrashlyticsCore: Removing session part files for ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.148 24986 25028 D CrashlyticsCore: Opening a new session with ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:38:59.172 24986 24986 D CrashlyticsCore: Crashlytics completed exception processing. Invoking default exception handler.
01-30 09:38:59.174 24986 25028 D CrashlyticsCore: Attempting to send crash report at time of crash...
01-30 09:39:00.938 25250 25250 I CrashlyticsCore: Initializing Crashlytics 2.6.7.30
01-30 09:39:00.946 25250 25250 D CrashlyticsCore: Installer package name is: null
01-30 09:39:00.966 25250 25289 D CrashlyticsCore: Found previous crash marker.
01-30 09:39:00.975 25250 25250 D CrashlyticsCore: Exception handling initialization successful
01-30 09:39:00.981 25250 25289 D CrashlyticsCore: Opening a new session with ID 5C513F7C03D0-0001-62A2-AF0E1194ACF2
01-30 09:39:03.065 25250 25289 D CrashlyticsCore: Initialization marker file created.
01-30 09:39:03.075 25250 25289 D CrashlyticsCore: Finalizing previously open sessions.
01-30 09:39:03.091 25250 25289 D CrashlyticsCore: Closing open sessions.
01-30 09:39:03.091 25250 25289 D CrashlyticsCore: Closing session: 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.092 25250 25289 D CrashlyticsCore: Collecting session parts for ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.094 25250 25289 D CrashlyticsCore: Session 5C513F7B0091-0002-619A-AF0E1194ACF2 has fatal exception: false
01-30 09:39:03.096 25250 25289 D CrashlyticsCore: Session 5C513F7B0091-0002-619A-AF0E1194ACF2 has non-fatal exceptions: false
01-30 09:39:03.097 25250 25289 D CrashlyticsCore: No events present for session ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.097 25250 25289 D CrashlyticsCore: Removing session part files for ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.101 25250 25289 D CrashlyticsCore: Closed all previously open sessions
01-30 09:39:03.108 25250 25301 D CrashlyticsCore: Starting report processing in 1.0 second(s)...
01-30 09:39:03.109 25250 25289 D CrashlyticsCore: Initialization marker file removed: true
01-30 09:39:04.111 25250 25301 D CrashlyticsCore: Checking for crash reports...
01-30 09:39:04.125 25250 25301 D CrashlyticsCore: Found crash report /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C513E7B02FD-0001-619A-AF0E1194ACF2.cls
01-30 09:39:04.128 25250 25301 D CrashlyticsCore: Attempting to send 1 report(s)
01-30 09:39:05.091 25250 25301 D CrashlyticsCore: Adding single file 5C513E7B02FD-0001-619A-AF0E1194ACF2.cls to report 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:39:05.100 25250 25301 D CrashlyticsCore: Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/com..kitil/reports
01-30 09:39:05.610 25250 25301 D CrashlyticsCore: Create report request ID: null
01-30 09:39:05.611 25250 25301 D CrashlyticsCore: Result was: 202
01-30 09:39:05.613 25250 25301 I CrashlyticsCore: Crashlytics report upload complete: 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:39:05.614 25250 25301 D CrashlyticsCore: Removing report at /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C513E7B02FD-0001-619A-AF0E1194ACF2.cls
01-30 09:39:05.618 25250 25301 D CrashlyticsCore: Checking for crash reports...
01-30 09:39:05.627 25250 25301 D CrashlyticsCore: No reports found.
我再次尝试并收到此错误:
01-30 11:09:45.711 571 605 D Fabric : Loaded cached settings: {"settings_version":2,"cache_duration":60,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":true,"firebase_crashlytics_enabled":false},"analytics":{"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events","flush_interval_secs":600,"max_file_count_per_send":1,"track_custom_events":true,"track_predefined_events":true,"track_view_controllers":false,"flush_on_background":true,"max_byte_size_per_file":8000,"max_pending_send_file_count":100,"sampling_rate":1,"forward_to_google_analytics":false,"include_purchase_events_in_forwarded_events":false},"beta":{"update_suspend_duration":1209600,"update_endpoint":""},"app":{"identifier":"com.kharazmico.KITIL","status":"activated","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.kharazmico.kitil","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.kharazmico.kitil\/reports","ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/com.kharazmico.kitil\/minidumps","update_required":false},"session":{"log_buffer_size":64000,"max_chained_exception_depth":16,"max_complete_sessions_count":4,"max_custom_exception_events":8,"max_custom_key_value_pairs":64,"identifier_mask":255},"prompt":{"title":"Send Crash Report?","message":"Looks like we crashed! Please help us fix the problem by sending a crash report.","send_button_title":"Send","show_cancel_button":true,"cancel_button_title":"Don't Send","show_always_send_button":true,"always_send_button_title":"Always Send"},"expires_at":1548833904681}
01-30 11:09:45.711 571 605 D Fabric : Cached settings have expired.
01-30 11:09:45.750 571 605 D Fabric : Requesting settings from https://settings.crashlytics.com/spi/v2/platforms/android/apps/com..KITIL/settings
01-30 11:09:45.752 571 605 D Fabric : Settings query params were: {instance=cb01562e3a7a8f402cebabbfddc9385b057fa76d, build_version=104, display_version=1.0.4, source=1, icon_hash=9c4d5c584a29e3b915652a0c7506ec23791535d7}
01-30 11:09:45.835 571 617 D Fabric : Using AdvertisingInfo from Reflection Provider
01-30 11:09:47.108 571 605 D Fabric : Settings result was: 200
01-30 11:09:47.119 571 605 D Fabric : Settings request ID: ee5f21c7815d9a2cc78fbea383b1a313
01-30 11:09:47.121 571 605 D Fabric : Writing settings to cache file...
01-30 11:09:47.135 571 605 D Fabric : Loaded settings: {"settings_version":2,"cache_duration":60,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":true,"firebase_crashlytics_enabled":false},"analytics":{"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events","flush_interval_secs":600,"max_file_count_per_send":1,"track_custom_events":true,"track_predefined_events":true,"track_view_controllers":false,"flush_on_background":true,"max_byte_size_per_file":8000,"max_pending_send_file_count":100,"sampling_rate":1,"forward_to_google_analytics":false,"include_purchase_events_in_forwarded_events":false},"beta":{"update_suspend_duration":1209600,"update_endpoint":""},"app":{"identifier":"com..KITIL","status":"activated","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com..kitil","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com..kitil\/reports","ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/com..kitil\/minidumps","update_required":false},"session":{"log_buffer_size":64000,"max_chained_exception_depth":16,"max_complete_sessions_count":4,"max_custom_exception_events":8,"max_custom_key_value_pairs":64,"identifier_mask":255},"prompt":{"title":"Send Crash Report?","message":"Looks like we crashed! Please help us fix the problem by sending a crash report.","send_button_title":"Send","show_cancel_button":true,"cancel_button_title":"Don't Send","show_always_send_button":true,"always_send_button_title":"Always Send"},"expires_at":1548834047120}
01-30 11:09:47.136 571 605 D Fabric : Build ID is: 17930dcb-1328-49b7-a31b-dab343f6e4d4
01-30 11:09:47.143 571 611 D Fabric : Could not find method: isDataCollectionDefaultEnabled []
01-30 11:09:47.144 571 620 D CrashlyticsCore: Initialization marker file created.
01-30 11:09:47.153 571 610 D Fabric : Could not find method: isDataCollectionDefaultEnabled []
01-30 11:09:47.154 571 620 D CrashlyticsCore: Finalizing previously open sessions.
01-30 11:09:47.170 571 620 D CrashlyticsCore: Closing open sessions.
01-30 11:09:47.170 571 620 D CrashlyticsCore: Closing session: 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.170 571 620 D CrashlyticsCore: Collecting session parts for ID 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.173 571 620 D CrashlyticsCore: Session 5C5154BF0366-0002-7F34-AF0E1194ACF2 has fatal exception: false
01-30 11:09:47.175 571 620 D CrashlyticsCore: Session 5C5154BF0366-0002-7F34-AF0E1194ACF2 has non-fatal exceptions: false
01-30 11:09:47.175 571 620 D CrashlyticsCore: No events present for session ID 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.175 571 620 D CrashlyticsCore: Removing session part files for ID 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.180 571 620 D CrashlyticsCore: Closed all previously open sessions
01-30 11:09:47.189 571 635 D CrashlyticsCore: Starting report processing in 1.0 second(s)...
01-30 11:09:47.189 571 620 D CrashlyticsCore: Initialization marker file removed: true
01-30 11:09:48.200 571 635 D CrashlyticsCore: Checking for crash reports...
01-30 11:09:48.213 571 635 D CrashlyticsCore: Found crash report /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C5154330130-0001-7F34-AF0E1194ACF2.cls
01-30 11:09:48.216 571 635 D CrashlyticsCore: Attempting to send 1 report(s)
01-30 11:09:49.160 571 635 D CrashlyticsCore: Adding single file 5C5154330130-0001-7F34-AF0E1194ACF2.cls to report 5C5154330130-0001-7F34-AF0E1194ACF2
01-30 11:09:49.169 571 635 D CrashlyticsCore: Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/com..kitil/reports
01-30 11:09:49.630 571 635 D CrashlyticsCore: Create report request ID: null
01-30 11:09:49.630 571 635 D CrashlyticsCore: Result was: 202
01-30 11:09:49.632 571 635 I CrashlyticsCore: Crashlytics report upload complete: 5C5154330130-0001-7F34-AF0E1194ACF2
01-30 11:09:49.634 571 635 D CrashlyticsCore: Removing report at /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C5154330130-0001-7F34-AF0E1194ACF2.cls
01-30 11:09:49.636 571 635 D CrashlyticsCore: Checking for crash reports...
01-30 11:09:49.648 571 635 D CrashlyticsCore: No reports found.
答案 0 :(得分:2)
这发生在我身上,因为我在清单中有此内容:
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
答案 1 :(得分:2)
假设:这仅发生在从Fabric迁移的人中。
对于那些在Firebase控制台的Crashlytics选项卡中看不到任何崩溃的用户,请尝试在初始化FirebaseApp上下文之前在应用程序中手动启用Crashlytics。
FirebaseApp.initializeApp(this)
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true)
// Optional. Uncomment if you are using analytics.
// FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(true)
在将应用程序从Android Studio重建并安装到物理设备,并再次产生崩溃之后,我成功获得了崩溃报告,该报告显示在Firebase控制台中。以前的报告没有出现(在某种程度上是可以预期的,因为没有报告)。
是什么促使我这样做的?
我正从Fabric迁移到Firebase,由于2020年11月15日Fabric被弃用并关闭,我现在正像许多人一样迁移。
我使用adb shell setprop log.tag.FirebaseCrashlytics DEBUG
启用了日志。这是testing your implementation的一部分。
由于崩溃报告存在问题,因此我启用了该功能,以查看这些日志中是否有有用的东西。
我注意到的是FirebaseCrashlytics加载缓存的设置(如果有的话)。通读它们,我发现了一个有趣的键值对,可能是个问题:
"firebase_crashlytics_enabled":false
此设置很奇怪。还有与Firebase Analytics相关的另一项:"collect_analytics":false
。
尽管我从未明确关闭它们,但由于某些原因,它们都是错误的。从来没有玩过这些设置。仅从Fabric迁移到Firebase。
09-25 11:08:50.045 30646 30646 D FirebaseCrashlytics: Loaded cached settings: {"settings_version":3,"cache_duration":86400,
"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":false,"firebase_crashlytics_enabled":false},
"app":{"status":"activated","update_required":false,"report_upload_variant":2,"native_report_upload_variant":2},
"fabric":{"org_id":"FabricApiKeyWasHere","bundle_id":"your.app.package.name"},
"expires_at":1601028354301}
启用Crashlytics(如本文开头所述),我能够打开崩溃报告并使报告显示在Firebase控制台中。请注意,缓存的设置仍然具有"firebase_crashlytics_enabled":false
。即使在多次重新安装/重新运行应用程序之后。
答案 2 :(得分:0)
当我将Yposition
上的gradle版本从gradle-wrapper.properties
更新为gradle-5.4.1-all.zip
时,我开始接收日志
我仍然在日志中看到:
FirebaseCrashlytics:加载的缓存设置:{...“ firebase_crashlytics_enabled”:false ...}
和:
FirebaseCrashlytics:已禁用“发送到报告端点”。删除报告端点报告。
但是无论如何都在发送报告。尽管有时发送它会花费更长的时间,所以我建议在崩溃后几分钟内重新打开并保持打开状态。
其他一些人在this github thread on firebase sdk上遇到了相同的问题