Advanced Firebase and Crashlytics setup

Firebase and Crashlytics in iOS and iPadOS

Handling dSYMS for humand-readable crash reports

Piero Sifuentes
3 min readJul 23, 2019
Photo by Markus Spiske on Unsplash

Here we are again, we started this Firebase Article due a lack/outdated documentation. Here we’re gonna talk about advanced guidelines to integrate Firebase and Crashlytics, don’t forget to take a look to the basic integration here:

At this point you should be done with you Firebase integration but there’re a few steps to take on count. Firebase let us get deobfuscated human-readable crash reports processing your debug symbol (.dSYM), but it could fail some times, we are going to explain how to solve it.

Get deobfuscated crash reports

All the debug information for your iOS application is contained in a dSYM file. As Firebase said, there are a few situations when dSYM uploads fail, usually because of unique project configurations or Bitcode in your app. When an upload fails, Crashlytics displays a “Missing dSYM” alert in the Firebase console to let you know that it can’t display crash reports properly.

Crashlytics dysm page on Firebase Console next to firebase dashboard

If you get that alert, there are two things you can try to resolve the issue: check that Xcode is producing the correct dSYM files and, if it is, run the dSYM upload script manually.

Check if Xcode is producing debug symbol files

More often than not, symbol files go missing because Xcode simply isn’t producing them. We have covered this topic in our first guide here. Anyway, these are the steps you must follow to check if your project is generating dSYMs with every build:

  1. Open your project in Xcode, and select the project file in the Xcode Navigator.
  2. Select your main build target from the Select a project or target dropdown.
  3. Open the target’s Build Settings tab.
  4. Click All near the top of the tab.
  5. Search for “debug information format”.
  6. Set Debug Information Format to DWARF with dSYM File.

Once you’ve done that, build your app again and check the Firebase console to see if Crashlytics can find your dSYMs.
And remember, you must generate a crash, check and follow the steps from here.

Run the upload symbols script manually

We can create a run script in Xcode to run the upload dSYMs to Crashlytics manually.

Crashlytics installed by cocoapods:

If you did integrate Firebase Crashlytics through cocoapods, you must use the following run script. Remember to change/add your correct GoogleService-Info.plist file direction.

"${PODS_ROOT}/Fabric/upload-symbols" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Crashlytics installed manually:

If you did integrate Firebase Crashlytics manually, you must use the following run script. Remember to change/add your correct GoogleService-Info.plist file and correct Firebase Crashlytic Fabric file direction.

"${PROJECT_DIR}/Firebase/Fabric.framework/upload-symbols” -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Important Bonus track, previous Fabric Setup:

If you’re working with an app that you previously linked from Fabric to Firebase Crashlytics, pass in your Fabric API Key to run the upload symbols script. That is, in the following options to run the script, use -a fabric-api-key instead of-gsp path/to/GoogleService-Info.plist. Also you can add both run sctips, one for Firebase Crashlytics and the other one for Fabric Crashlytics.

"${PROJECT_DIR}/Firebase/Fabric.framework/upload-symbols” -a FabricAPIKeyHERE -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Just for this case, you’ll need to add your plist as input files for this run script:

$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

For both cases, Firebase says:
If you’re having trouble, run upload-symbols without any parameters to get usage notes and additional instructions.

And remember, this new run script should be before the Crashlytic Run Script. For more details take a look to our first guide.

Hope this guide will be helpful. Thanks for reading.

--

--