即使没有选择加入报告,Crashlytics仍然可以正常工作。但是一旦按照教程设置加入报告,它就不再报告任何内容。
具体而言,我将以下内容添加到AndroidManifest.xml
中:
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
我在onCreate
中添加了以下内容:
Fabric.with(this, Crashlytics())
使用调试器,我可以确定上面的代码已经执行。
然而,Crashlytics 并没有报告任何错误。相反,日志记录器(logger)显示以下内容:
D/Fabric: Falling back to Crashlytics key lookup from Manifest
D/Fabric: Falling back to Crashlytics key lookup from Strings
D/Fabric: Generating Crashlytics ApiKey from google_app_id in Strings
D/Fabric: Using AdvertisingInfo from Preference Store
D/Fabric: Falling back to Crashlytics key lookup from Manifest
D/Fabric: Falling back to Crashlytics key lookup from Strings
D/Fabric: Build ID is: ...
D/CrashlyticsCore: Crashlytics is disabled, because data collection is disabled by Firebase.
D/Fabric: Initializing io.fabric.sdk.android:fabric [Version: 1.4.6.29], with the following kits:
com.crashlytics.sdk.android:crashlytics [Version: 2.9.7.29]
com.crashlytics.sdk.android:beta [Version: 1.2.10.27]
com.crashlytics.sdk.android:answers [Version: 1.4.5.29]
com.crashlytics.sdk.android.crashlytics-core [Version: 2.6.6.29]
D/Fabric: Not fetching settings, because data collection is disabled by Firebase.
D/Fabric: Falling back to Crashlytics key lookup from Manifest
D/Fabric: Falling back to Crashlytics key lookup from Strings
D/Fabric: Build ID is: ...
D/Fabric: Analytics collection disabled, because data collection is disabled by Firebase.
D/Fabric: Could not get parcel from Google Play Service to capture AdvertisingId
D/Fabric: Could not get parcel from Google Play Service to capture Advertising limitAdTracking
D/Fabric: AdvertisingInfo not present
D/Fabric: Asychronously getting Advertising Info and storing it to preferences
我注意到了这条有趣的记录:D/CrashlyticsCore: 因为 Firebase 禁用了数据收集,Crashlytics 被禁用。
这可能是问题的根源。但我找不到有关该日志的任何信息。