Adding missing dSYMs to Crashlytics with Fastlane

Recently we have faced an interesting issue with missing dSYMs... which was not an issue in fact but hindered automation for some Crashlytics users.

Recently we have faced an interesting issue with missing dSYMs... which was not an issue in fact but hindered automation for some Crashlytics users.

Everything started with a user reporting that in the build log everything seems to be fine but the dSYM file was not uploaded to Crashlytics. At first we thought that something went wrong with the step so we asked for the build log, but we didn’t find anything related to it, so we also checked the version number and UUID on Crashlytics and tried to upload the generated dSYMs manually, but we didn’t succeed.

Finally in the documentation of Fabric we found some useful articles about missing dSYMs. One says that “There can be certain situations however, when dSYM uploads fail because of unique project configurations or if you’re using Bitcode in your app”, so we checked again the build log and we found these two lines:

  • UploadBitcode: yes
  • CompileBitcode: yes

The issue is found, but how do we fix it?

What is Bitcode? What does it do?

Bitcode appeared first when Apple released Xcode 7 and it is an intermediate representation of a compiled program (part of app thinning) and it will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to store. (For more information check this page.)

Let's get back to the Fabric article, which also says that "For Bitcode enabled builds that have been released to the iTunes store or submitted to TestFlight, Apple generates new dSYMs so we have to download the regenerated dSYMs from Xcode and then upload them to Crashlytics".

Yeah, this will work, but we wanted all of these things works automatically, so what's next?

Solve it with Fastlane!

Fastlane offers a solution with which you can download all available dSYM files from iTunes Connect and upload them to the crash reporting service (supported services are Crashlytics, Sentry, HockeyApp).

Note: The guide to setup the download_dsyms tool can be found here, take special care of the release versions.

Just define a lane in your Fastfile:


lane :refresh_dsyms do
 download_dsyms # Download dSYM files from iTC
 upload_symbols_to_crashlytics # Upload them to Crashlytics
 clean_build_artifacts # Delete the local dSYM files
end
Copy code

... and add a Fastlane step which runs your refresh_dsyms lane to a new workflow and set up a scheduled build to this new workflow. The schedule should be set to a time that is surely hours after you finish developing this app. This way if you deploy to iTunes Connect during the day, your build scheduled to the night will download the appropriate dSYMs and upload it to Crashlytics.

Note: The scheduled build will run automatically at the time(s) set, regardless of whether you've released a new version to iTunes Connect or not.

Happy coding!

No items found.
The Mobile DevOps Newsletter

Explore more topics

App Development

Learn how to optimize your mobile app deployment processes for iOS, Android, Flutter, ReactNative, and more

Bitrise & Community

Check out the latest from Bitrise and the community. Learn about the upcoming mobile events, employee spotlights, women in tech, and more

Mobile App Releases

Learn how to release faster, better apps on the App Store, Google Play Store, Huawei AppGallery, and other app stores

Mobile DevOps

Learn Mobile DevOps best practices such as DevOps for iOS, Android, and industry-specific DevOps tips for mobile engineers

Mobile Testing & Security

Learn how to optimize mobile testing and security — from automated security checks to robust mobile testing and more.

Product Updates

Check out the latest product updates from Bitrise — Build Insights updates, product news, and more.

The Mobile DevOps Newsletter

Join 1000s of your peers. Sign up to receive Mobile DevOps tips, news, and best practice guides once every two weeks.