You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

非CocoaPods集成Firebase Crashlytics 仪表盘无数据问题求助

Troubleshooting Firebase Crashlytics (No Dashboard Data) in Swift (Non-CocoaPods Setup)

Hey there, let’s walk through why your Crashlytics dashboard isn’t populating data even after you’ve checked off those initial setup steps. I’ve debugged this exact scenario dozens of times, so here are the critical checks to run through:

1. Validate Your Run Script (The #1 Culprit)

This is where most non-CocoaPods setups go wrong. Double-check your build phase script:

  • Head to your target’s Build Phases > Run Script
  • Since you’re not using CocoaPods, replace the standard pod path with the local path to your Fabric framework. For example, if you dragged frameworks into your project root, the script should look like:
    "${PROJECT_DIR}/Fabric.framework/run"
    
  • Ensure the script runs after "Compile Sources" and before "Copy Bundle Resources" (drag the script block to reorder if needed)
  • Uncheck the "Run script only when installing" box—this needs to execute every time you build or archive.

2. Confirm Initialization Code in AppDelegate/SceneDelegate

Make sure your setup code is correctly implemented in your launch logic:

import Firebase
import Crashlytics

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
    // Force enable collection (helpful for testing; you can toggle this for production later)
    Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
    // Optional: Uncomment to test a crash immediately
    // Crashlytics.crashlytics().crash()
    return true
}
  • If you’re using a SwiftUI @main app, move this code to your app struct’s init() method instead.
  • Don’t forget to import both Firebase and Crashlytics (Fabric is now wrapped into Firebase’s modern Crashlytics SDK).

3. Verify Framework & Bridging Header Setup

Since you’re doing a manual integration, confirm these details:

  • Go to Build Phases > Link Binary With Libraries—ensure FirebaseCore.framework, Crashlytics.framework, and Fabric.framework are all added and marked as "Required".
  • Check your Objective-C bridging header includes these imports:
    #import <Firebase/Firebase.h>
    #import <Crashlytics/Crashlytics.h>
    #import <Fabric/Fabric.h>
    
  • Confirm the bridging header path is correctly set in Build Settings > Swift Compiler - General > Objective-C Bridging Header (it should look like $(SRCROOT)/YourProjectName/YourBridgingHeader.h).

4. Test a Crash & Wait for Sync

Crashlytics doesn’t send reports instantly—follow this testing flow:

  • Build and run the app on a physical device (simulator crashes are often not reported reliably).
  • Trigger a crash (either via the test crash() method, or by creating an unhandled exception like force-unwrapping a nil optional).
  • Restart the app after the crash—Crashlytics sends the report on the next launch.
  • Wait 5-10 minutes for the dashboard to update (first-time reports can sometimes take a bit longer to process).

5. Check Build Settings & Environment

  • Ensure you’re not accidentally disabling collection in debug mode. If you have conditional code like this, comment it out for testing:
    #if !DEBUG
    Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
    #endif
    
  • Verify your GoogleService-Info.plist has its "Target Membership" box checked (in the Xcode file inspector) so it’s included in your build.
  • Confirm the bundle ID in your plist matches exactly with the one registered in your Firebase project.

6. Double-Check Firebase Console Setup

  • Head to your Firebase Console > Crashlytics > Settings—make sure your app is registered with the correct bundle ID and there are no pending setup prompts.
  • If you just created the project, sometimes the console needs a few minutes to sync with your app’s first report.

Go through each of these steps, and your Crashlytics data should start showing up in the dashboard shortly. Let me know if any of these checks uncover the issue!

内容的提问来源于stack exchange,提问作者Jamshed Alam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:09:58