简体   繁体   English

Firebase Crashlytics 在 Fabric 迁移后未报告崩溃

[英]Firebase Crashlytics not reporting crashes after Fabric Migration

Recently we migrated our app from Fabric to Firebase Crashlytics and Firebase Analytics.最近,我们将应用程序从 Fabric 迁移到 Firebase Crashlytics 和 Firebase Analytics。 In android, everything works like a charm after following Google documentation.在 android 中,遵循 Google 文档后,一切都像魅力一样。 The problem is that in iOS we get no report on Firebase Crashlytics (works perfectly on Firebase Analytics)after following the same documentation.问题是在 iOS 中,我们没有得到关于 Firebase Crashlytics 的报告(在 Firebase Analytics 上完美运行)在遵循相同的文档之后。

Paths:路径:

Dev Google Service Info Plist: Supporting Files > Firebase > Dev > GoogleService-Info-Dev.plist开发 Google 服务信息 Plist: Supporting Files > Firebase > Dev > GoogleService-Info-Dev.plist

Prod Google Service Info Plist: Supporting Files > Firebase > Prod > GoogleService-Info-Prod.plist Prod Google 服务信息 Plist: Supporting Files > Firebase > Prod > GoogleService-Info-Prod.plist

Empty Plist: Supporting Files > GoogleService-Info.plist空 Plist: Supporting Files > GoogleService-Info.plist

Build Phases:构建阶段:

Run Script (GoogleService-Info.plist assignment) :运行脚本(GoogleService-Info.plist 分配)

if [ "${CONFIGURATION}" = "Release" ]; then
    GOOGLE_SERVICE_INFO_PLIST_FROM="${PROJECT_DIR}/Supporting Files/Firebase/Prod/GoogleService-Info-Prod.plist"
else
    GOOGLE_SERVICE_INFO_PLIST_FROM="${PROJECT_DIR}/Supporting Files/Firebase/Dev/GoogleService-Info-Dev.plist"
fi

GOOGLE_SERVICE_INFO_PLIST_TO="${PROJECT_DIR}/Supporting Files/GoogleService-Info.plist" 
cp "${GOOGLE_SERVICE_INFO_PLIST_FROM}" "${GOOGLE_SERVICE_INFO_PLIST_TO}" 

Run Script (Firebase Crashlytics Run) :运行脚本(Firebase Crashlytics 运行)

# Run Firebase Crashlytics

"${PODS_ROOT}/FirebaseCrashlytics/run" -gsp "${PROJECT_DIR}/Supporting\ Files/GoogleService-Info.plist" 

AppDelegate:应用委托:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
       
   // Set Google -Info.plist for enviroment
       let filePath = Bundle.main.path(forResource: ULima.getInfoPlist(buildType: ULima.buildType), ofType: "plist")
   if let fileopts = FirebaseOptions(contentsOfFile: filePath!) {
       // Use Firebase library to configure APIs and Crashlytics
       FirebaseApp.configure(options: fileopts)
   }
  [...]
}
       

Crashlytics Console: Crashlytics 控制台:

Crashlytics 控制台

What I already tried:我已经尝试过的:

  • Checking if bundle id from project and Firebase console match检查项目中的捆绑包 ID 和 Firebase 控制台是否匹配
  • Checking if bundle id has and empty space检查bundle id是否有空空间
  • Running Project, press Stop, open app in simulator (so debugger doesn't interfere with crashlytics) and force crash运行项目,按停止,在模拟器中打开应用程序(因此调试器不会干扰崩溃分析)并强制崩溃
  • Waited more than 2 days for the crashes to appear等待超过 2 天的崩溃才出现
  • Setting Debug Information Format to DWARF with dSYM File.使用 dSYM 文件将调试信息格式设置为 DWARF。
  • Running just "${PODS_ROOT}/FirebaseCrashlytics/run"只运行"${PODS_ROOT}/FirebaseCrashlytics/run"
  • Check with Crashlytics.crashlytics().didCrashDuringPreviousExecution()检查Crashlytics.crashlytics().didCrashDuringPreviousExecution()
  • Added this to AppDelegate :将此添加到AppDelegate
        Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(false)

        Crashlytics.crashlytics().checkForUnsentReports { _ in
            Crashlytics.crashlytics().sendUnsentReports()
        }

The run script doesn't look fine to me.运行脚本对我来说看起来不太好。 There should be one or two separated commands:应该有一个或两个单独的命令:

  1. run (start) Firebase Crashlytics: "${PODS_ROOT}/FirebaseCrashlytics/run" (see docs )运行(开始)Firebase Crashlytics: "${PODS_ROOT}/FirebaseCrashlytics/run" (参见 文档
  2. if Firebase Crashlytics is unable to process the dSYM files itself, you should upload the dSYM file to Firebase to get deobfuscated crash reports (see docs )如果 Firebase Crashlytics 无法自行处理 dSYM 文件,您应该将 dSYM 文件上传到 Firebase 以获得去混淆的崩溃报告(请参阅文档

So I suggest you to edit your Firebase Crashlytics Run Script just to Run Crashlytics (without uploading any dSYM file).所以我建议你编辑你的 Firebase Crashlytics运行脚本只是为了运行 Crashlytics(不上传任何 dSYM 文件)。 If it helps and you can see a crash in console, than you can check if dSYM file is missing (so another script for uploading dSYM will be needed).如果它有帮助并且您可以在控制台中看到崩溃,那么您可以检查 dSYM 文件是否丢失(因此需要另一个用于上传 dSYM 的脚本)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM