firebase-ios-sdk: Firebase Crashlytics integration

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12 beta 6
  • Firebase SDK version: 6.32.0
  • Firebase Component: Crashlytics
  • Component version: [Firebase/Crashlytics] Version 6.32.0
  • Installation method: Swift Package Manager

[REQUIRED] Step 2: Describe the problem

I am having issue running Crashlytics and connecting it to the console.

Steps to reproduce:

Crashlytics was added by following the instructions here. Then we build/run/crash the app but nothing seems to be popping in the console. Afterwards we aded the run and upload-symbols scripts as part of the directory. Still wasn’t able to connect the the firebase console.

Please provide us with documentation/steps how to integrate Crashlytics with SPM?

Relevant Code:

// TODO(you): code here to reproduce the problem

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 28 (3 by maintainers)

Most upvoted comments

@tkrajacic in the build phase, try replacing ${PODS_ROOT}/FirebaseCrashlytics/run with ${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run

Hey folks, want to dig in further. We saw a case where GDTCORFlatFileStorage isn’t loading with binary frameworks. Can you try the following to confirm it’s the same issue:

  1. Run your app
  2. Go to the Debug Navigator in Xcode (the spray paint icon)
  3. Click “Memory” and then the tiny vertical lines and choose “View Memory Graph Hierarchy”

Screen Shot 2020-09-30 at 12 22 47 PM

  1. Then, add “GDT” to the filter at the bottom, and confirm whether GDTCORFlatFileStorage has loaded into the app?

Screen Shot 2020-09-30 at 12 23 00 PM

Okay we (@glaures-ioki) solved the problem for us 🎉

The issue was (as @samedson depicted) that some frameworks where not linked to the main app target 🤭 Why can that happen?! Well quite easy, we integrated Firebase via Carthage for a long time now, upgraded it in that time a lot and we think that Google added some frameworks that where suddenly there after the upgrade but we forgot to link them to the target. The app was just building fine and also didn’t crash nor log anything regarding the missing frameworks. In detail the missing frameworks where (it was the missing GoogleDataTransport framework that prevented the crash report to get submitted to the server):

Screen Shot 2020-10-13 at 11 45 27

There are different solutions we came up to check what frameworks could be missing:

  • Create an example project, add the same frameworks to the Cartfile as you do in your main project, run carthage to build the frameworks and add all frameworks from Carthage/Build/iOS to your project and compare them to your project.
  • Create an example project, integrate the framework via CocoaPods (since this seems to be the main method Google supports and maintains), run pod install and compare the frameworks CocoaPods links to your main app target.

To prevent such issues to happen in future, Google could (additionally to handling it gracefully) execute some runtime checks on app start in the Firebase framework and at least print some logs when required frameworks are missing - wdyt?

Hope that helps some of you guys ✌️

@stherold sorry, what about swift package manager?

We’re not on coe 12 yet. Also we can easily cche Carthage dependencies on Bitrise but not SPM ones. So Carthage is the better option. Apart from that why should the framewok be different when using SPM over Carthage? The source code behavior should be the same.

@stherold sorry, what about swift package manager?

@tkrajacic okay for Carthage integration I downloaded the framework from https://firebase.google.com/download/ios since the run is not included at all in the Carthage download. I extracted the 2 scripts run and upload-symbols into a sub-directory of my project and call it as the last build phase via:

${PROJECT_DIR}/dependencies/firebase-crashlytics-dsym-upload/run

Does this make sense?

@kevinrefermat oh I wasn’t asking for me. I was asking if that might be the user’s problem here.

Maybe a stupid question, but how did you run the build phase that previously ran the script ${PODS_ROOT}/FirebaseCrashlytics/run? It is not mentioned anywhere in the instructions.

I tested right now and I can confirm it with the Carthage integration, Xcode 12.0 (12A7209) and Firebase 6.33.0.

What exactly makes the website recognize the app? Is it the run script that runs at compile time or is it something at runtime?

As I wrote above crash reports get actually sent to the server.

If it is of some relevance, this is our Info.plist:

Screen Shot 2020-09-24 at 12 16 28