Crashlytics不会在iOS中发送崩溃数据

1wnzp6jl  于 2022-11-26  发布在  iOS
关注(0)|答案(1)|浏览(188)

我试图实现crashlythics到一个空的项目测试porpuses,即使我完全按照官方的gudes this和这一个,但我不能有太多的运气,在遵循第二个指南后,我有这个在控制台日志

2022-07-25 17:21:38.157616+0200 crashlythics test[607:149616] 9.4.0 - [FirebaseCore][I-COR000001] Configuring the default app.
2022-07-25 17:21:38.183569+0200 crashlythics test[607:149595] [Firebase/Crashlytics] Version 9.4.0
2022-07-25 17:21:38.183961+0200 crashlythics test[607:149616] 9.4.0 - [FirebaseCrashlytics][I-CLS000000] [Crashlytics] Running on iPhone12,8, 14.0.0 (18A373)
2022-07-25 17:21:38.207022+0200 crashlythics test[607:149616] 9.4.0 - [FirebaseCore][I-COR000033] Data Collection flag is not set.
2022-07-25 17:21:38.208194+0200 crashlythics test[607:149617] 9.4.0 - [FirebaseCrashlytics][I-CLS000000] Root: /var/mobile/Containers/Data/Application/98366F06-111E-42DF-9519-A1E5D2CA50E9/Library/Caches/com.crashlytics.data/D.Pashkov.crashlythics-test
2022-07-25 17:21:38.211229+0200 crashlythics test[607:149615] 9.4.0 - [FirebaseCrashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Firebase Analytics SDK not detected. Crash-free statistics and breadcrumbs will not be reported
2022-07-25 17:21:38.211277+0200 crashlythics test[607:149615] 9.4.0 - [FirebaseCrashlytics][I-CLS000000] Automatic data collection is enabled.
2022-07-25 17:21:38.211403+0200 crashlythics test[607:149615] 9.4.0 - [FirebaseCrashlytics][I-CLS000000] Unsent reports will be uploaded at startup
Fatal error: Crash was triggered: file crashlythics_test/ContentView.swift, line 13
2022-07-25 17:21:58.490175+0200 crashlythics test[607:149595] Fatal error: Crash was triggered: file crashlythics_test/ContentView.swift, line 13
(lldb)

我不确定是否需要视图中的代码,因为它是一个空项目,但为了以防万一,我将在这里复制过去:
测试应用程序:

import SwiftUI
import FirebaseCore

class AppDelegate: NSObject, UIApplicationDelegate {
  func application(_ application: UIApplication,
                   didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    FirebaseApp.configure()

    return true
  }
}

@main
struct crashlythics_testApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

ContentView.swift:

import SwiftUI

struct ContentView: View {
    var body: some View {
        Button("Crash") {
          fatalError("Crash was triggered")
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
jtoj6r0c

jtoj6r0c1#

日志表明Crashlytics SDK已正确安装和初始化。
测试时,请确保您遵循了这里提到的步骤。特别是停止Xcode的部分。这些步骤如下:
1.从Xcode运行应用程序
1.在设备/模拟器中运行后,在Xcode中点击“停止”
1.然后在设备中打开应用程序并导致测试崩溃。
1.从Xcode再次运行应用程序
在此之后,调试日志应该如下所示:

9.3.0 - [FirebaseCrashlytics][I-CLS000000] [Firebase/Crashlytics] Packaged report with id '5caa69396c6f47479add349810a604bc' for submission
9.3.0 - [FirebaseCrashlytics][I-CLS000000] Submitting report async
9.3.0 - [FirebaseCrashlytics][I-CLS000000] Completed report submission with id: 5caa69396c6f47479add349810a604bc

这些步骤是必需的,因为Xcode附加了一个调试器,该调试器阻止Crashlytics获取崩溃数据。

相关问题