iOS — Firebase Crashlytics — Missing dSYMs files

Sheikhamais
5 min readOct 3, 2021

I was asked to integrate firebase crashlytics in our iOS application. I went to the firebase console where my iOS app was added, from where I enabled firebase crashlytics, created a dummy crash and installed the application on my device. I ran that without debug mode, and did a test crash, reopened the application so that a successful crash report could be sent to firebase. I went to firebase console and refreshed, and -Boom, I came up with an error (In firebase console):

(I did crash multiple times though, it takes a little while to show up in console) It was a pain to get rid of this error, and therefore I am here going to share my experience on how did I managed to solve it.

Before that: What are dSYM files ?

On Search Ans: Debug Symbol files (dSYM) files are required by Firebase Crashlytics to give the app developers a human-readable crash report on its console.

Idea: I understood this, as that dSYMs are associated with individual builds and therefore we need to get all dSYMs for every individual crash, which may occur on a variety of devices (across users). I guess my first approach was unsuccessful because I didn’t had this idea. (would love to hear authentic information about it in comments below)

Solving the Problem: (you may directly jump to approach 2, if you are not interested in knowing my story)

( Approach 1 - Unsuccessful )

Following the documentation from firebase, I managed to dump all my dSYMs files available on my local machine using this command:

Which resulted like this: (copy and paste all this content in a temporary Xcode file for searching)

Then go to the firebase console (your project)> crashlytics. Then hit the dSYMs tab, scroll to the bottom where you will see (something like):

Here are your required uuid’s of dsyms which firebase need to process your crashes. Copy id’s (each) and search individually in that temporary Xcode file where paths are pasted.

(I got unsuccessful here — I did find the dsyms for my dummy project, and didn’t found them for my real project)

Lastly, if you found your dsyms, see the format here below and create your command to run in terminal:

The first line is the paths to upload-symbols file which is located inside your firebase module, easy way to find this is to open firebase module in finder, and search upload-symbols in that folder, secondary click on it and hit option + copy file path. You got your first line.

Second one is the path to your google plist file, do the same copy and replace in the above command.

And the last one is the path to your found dsym file. You will have to upload each separately.

Remove the unnecessary spaces and line breaks above and run the command in the terminal. Upon successful upload, you will see a success message there in the terminal. Do it for each file. After doing this, you have to do a test crash again to see the report. In my case, my new crash was parsed successfully, and I got the information of my crash (in my dummy project). But I guess this will also not parse all crashes in future occurring on various devices coming from unknown places.

Therefore, jump to this approach below.

( Approach 2 — Successful ):

Now the idea is to add run script in your build phases in your project.

Sounds nice, will be added with each build you make and you may now get dsyms from anywhere your app is installed. (share thoughts)

Great, now go to your project > build phases. Hit the plus button and hit new run script phase. After you see your new run script here you then have to paste the following command in it:

-For those who added firebase dependencies through swift package manager

“${BUILD_DIR%Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/upload-symbols” -gsp “${PROJECT_DIR}/GoogleService-Info.plist” -p ios “${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}”

Here, please break down the above command, make sure your file paths are correct in the above command, else your project won’t compile.

-For those who have installed firebase pods, you may use:

“${PODS_ROOT}/firebase-ios-sdk/Crashlytics/upload-symbols” -gsp “${GOOGLE_INFO_PLIST_PATH}” -p ios “${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}”

Break down the above commands into three parts, separated by -gsp and -p ios respectively. These are the paths to your upload-symbols, google info plist, and dsyms directory. Carefully find your own path through project navigator correct the path according your project.

Now all you have to just add this in your newly created run script. (Here it is)

We are almost done. After doing this, I did a test crash again as described above, and again it was unprocessed, missing dsym. -ugh

After looking into it, I found out that I would have to add another scheme.

Added a similar run script, now paste the following command in this (this is for the run (named) script) that ships with firebase.

“${BUILD_DIR%Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run”

Note: I am using swift package manager, for those who are using pod will have to alter the above command like this:

“${PODS_ROOT}/Crashlytics/run”

Carefully change your paths, as per files in your projects. For breaking down to avoid errors, add one scheme at a time and hit Cmd + B, in order to check your project is being build and the paths are correct.

By doing this you are done and good to go. Do a test crash and you will now be able to see your crash report in your firebase crashlytics console.

If this helps you, please give a clap, and do share. Happy coding :)

--

--