gpt4 book ai didi

android - 在 Debug模式下禁用新的 Firebase Crashlytics

转载 作者:行者123 更新时间:2023-12-03 13:24:25 27 4
gpt4 key购买 nike

我最近从 Fabric 1 切换到新的 Firebase Crashlytics,但我找不到在 Debug模式下禁用 Crashlytics 的替代方法。

织物:

val crashlytics = Crashlytics.Builder().core(CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build()
Fabric.with(this, crashlytics, Answers())

有人知道答案吗?我见过 FirebaseCrashlytics类现在在内部设置了它的核心。我试过 FirebaseCrashlytics(CrashlyticsCore.??).getInstance() ,但这种构造函数不起作用。

还有 CrashlyticsCore类不再有 .Builder()可用的

最佳答案

要以编程方式在 Application 类中使用以下代码

FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(!BuildConfig.DEBUG)
//enabled only for signed builds

Enable collection for select users by calling the Crashlytics data collection override at runtime. The override value persists across launches of your app so Crashlytics can automatically collect reports for future launches of that app instance. To opt out of automatic crash reporting, pass false as the override value. When set to false, the new value does not apply until the next run of the app.


这是文档的链接 https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android#enable-reporting

关于android - 在 Debug模式下禁用新的 Firebase Crashlytics,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62402856/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com