Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload dSYMS to Firebase via Fastlane

I am struggling to upload dSYM files to Firebase via Fastlane. I have a lane that looks like the following:

desc "Fetch and upload dSYM files to Firebase Crashlytics"
lane :refresh_dsyms_firebase do |options|
  download_dsyms(version: options[:version])        
  upload_symbols_to_crashlytics(gsp_path: "./App/GoogleService-Info.plist") 
  clean_build_artifacts
end

I confirmed that that is the correct path to the plist file, but when I try to run the lane at first I see the following:

[17:22:47]: invalid byte sequence in UTF-8
[17:22:47]: invalid byte sequence in UTF-8
[17:22:47]: invalid byte sequence in UTF-8

and then one of these for every dSYM file found:

[17:22:48]: Uploading '70DBE65E-227E-3754-89F2-EEFA6B8EEC2F.dSYM'...
[17:22:48]: Shell command exited with exit status  instead of 0.

I am trying to determine exactly what I am missing from this process. Does anyone have ideas? I am fairly new to Fastlane, so definitely assume I could be missing something basic. (Although, that empty exit status is a bit weird).

fastlane 2.107.0

EDIT(June 7th: 2021): I updated the answer from my own to one that was helpful to me at the time this was written.

There are many other great answers on this page on using Fastlane as well - please check them out

like image 396
daredevil1234 Avatar asked Oct 29 '18 16:10

daredevil1234


People also ask

How do I upload dSYMs?

Upload the dSYM File to AppDynamics Using the UIFrom the Mobile App menu, click Configuration. Click Mobile App Configuration >. From dSYM Mappings, click Upload dSYM package file for iOS crashes. From the XCode dSYM package upload dialog, click Choose File.

How do I upload dSYM files to Firebase Crashlytics?

To manually upload your dSYMs, you can use the console-based "Drag and Drop" option to upload a zip archive containing your dSYM files (go to Firebase console > Crashlytics > dSYMs tab).

What is dSYMs file?

A dSYM file is an ELF file that contains DWARF (debugging with attributed record formats) debug information for your application. DWARF is a debugging file format that supports source-level debugging.


2 Answers

This may not be an option for most, but I just ended up fixing this by starting over. It may not be entirely obvious if you came over from Fabric, but I figured I would just rip off the band aid. My original setup was using the Fabric(Answers)/Firebase Crashlytics which is the Fabric->Firebase migration path, although subtle, the configuration between the two are slightly different and cause issues with upload_symbols_to_crashlytics

  1. Remove support for Fabric answers, or replace with https://firebase.google.com/docs/analytics/ios/start
  2. Remove the Fabric declaration in Info.plist
  3. Modify your existing run script in BuildPhases: replace your existing runscript with "${PODS_ROOT}/Fabric/run" and add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) to input files
  4. In you AppDelegate remove Fabric.with([Crashlytics.self]) and you can also kill the import Fabric as this is now covered by Firebase
  5. Unlink fabric, re-onboard Firebase crashlytics, and select new integration.
desc "Upload any dsyms in the current directory to crashlytics"
lane :upload_dsyms do |options|
  download_dsyms(version: version_number, build_number: build_number)
  upload_symbols_to_crashlytics(gsp_path: "./App/Resources/GoogleService-Info.plist")
  clean_build_artifacts
end
like image 128
Ryan Romanchuk Avatar answered Oct 17 '22 10:10

Ryan Romanchuk


anyone interested in this can follow the thread here: https://github.com/fastlane/fastlane/issues/13096

TL;DR: When you call

upload_symbols_to_crashlytics(gsp_path: "./App/GoogleService-Info.plist")

It will call a binary from the installed Fabric pod called upload_symbols and will look something like this:

./Pods/Fabric/upload-symbols -a db4d085462b3cd8e3ac3b50f118e273f077497b0 -gsp ./App/GoogleService-Info.plist -p ios /private/var/folders/x1/x6nqt4997t38zr9x7zwz72kh0000gn/T/d30181115-8238-1fr38bo/D4CE43B9-9350-3FEE-9E71-9E31T39080CD.dSYM

You'll notice that it calls it using both the Fabric API key and the GoogleService-Info.plist path. I do not know why but this will cause it not to upload. You'll have to temporarily remove the fabric configuration information from your Info.plist file before running the fastlane lane. (remember to re-add the fabric configuration).

like image 9
daredevil1234 Avatar answered Oct 17 '22 11:10

daredevil1234