iOS and FirebaseCrashlytics
Asked Answered
M

12

58

I am trying to follow the instructions on Firebase Docs to upload missing required dSYMs. However I am stuck on running the uploader script.

In my build phases I have

"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols -gsp${SRCROOT}/GoogleService-Info.plist -p ios ${SRCROOT}/appDsyms"

When I try building the iOS app with this, I get the error:

line 4: /path/to/Pods/FirebaseCrashlytics/upload-symbols -gsp/path/to/GoogleService-Info.plist -p ios /path/to/appDsyms: No such file or directory

Command PhaseScriptExecution failed with a nonzero exit code

When I try running the script from the terminal I get the error:

No Google App ID or Google Services file provided

I have verified that I have a Google Services file and am able to run my project using other firebase services that rely on it. I used to be able to upload Dysm files directly into the Firebase Console, but that changes on March 1.

Should this command be run as an XCode script or a command from the terminal? And, more importantly, does anyone understand how to resolve this issue?

Marillin answered 23/3, 2020 at 20:42 Comment(0)
N
22

After hours of struggling with this problem finally solved it using this approach:

use this command in Terminal: /path/to/pods/directory/FirebaseCrashlytics/upload-symbols -gsp /path/to/GoogleService-Info.plist -p ios /path/to/dSYMs

Important thing is instead of /path/to/pods/directory you should enter the path to your pods folder in your application folder, and instead of /path/to you should enter the path to the GoogleService-Info.plist which is in your project folder too. And the last one is, instead of /path/to/dSYMs you should enter the path to your archive which has the format of .xcarchive.

For finding the .xcarchive path, you should first archive your application, then go to XCode -> Organizer and select your build, then right click on it and select "Show in finder" and then right click on your .xcarchive file and select "Show package contents". This is it, you can copy this path and paste it instead of /path/to/dSYMs and then hit enter to start uploading to Firebase Crashlytics.

Check out this link for more information: Firebase Docs

Nonmetallic answered 5/4, 2020 at 18:57 Comment(7)
I have tried this solution but still showing the same (Required dsym files) in the firebase crashlytics console. Can you help me.Annadiana
And do we need to upload every dSYM file after archive?Annadiana
@MaheshNFC yes sure. What's the problem?Nonmetallic
Manually uploading debug information with every release, and hoping that it matches the compiled code? You don't see the problem with that? Wow.Mowry
@AndrewKoster You can always use another approaches too!Nonmetallic
I had an extra space in the command that was causing an issue!!Welfarism
Is there any way we can add proxy to this command? I have scenario where machine we are uploading script not enabled with internet.Fatherland
W
73

As of May 2020:

After Fabrics shut down, many developers faced such issues because Fabric was automatically creating the script to upload dSYM files from Xcode and we never pay attention to it.

Now as Fabric is replaced with FirebaseCrashlytics, in order to achieve this automatic mechanism, you can create a new run script and paste this script there:

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

enter image description here

This script will get the dSYM files and upload them to firebase servers so that you can see the crashes.

For multiple Schemes:

If your project has multiple schemes, you can simply create multiple such scripts by changing the path to the Google Plist file.

NOTE: You can also manually upload the dSYM files using upload-symbols tool [Check here], but it's always better to automate the process wherever we can.

EDIT: July 2020: When you see missing dSYM files for the crash in the Crashlytics dashboard, instead of getting the email for it, you can upload the dSYM file for the build as soon as you submit it for Apple review or for testing via Test Flight.

Missing dSYM is shown because when bitCode is enabled, the App Store Connect process the binary post uploading it and generates a new dSYM file.

You can find the dSYM file from the Activity section in the App Store Connect.

enter image description here

Waw answered 12/5, 2020 at 10:27 Comment(17)
Thank you for contributing! How do I get the dwarf DSYM folder path and file names?Marillin
@Marillin you just write the script as it is. You don't need to specify an exact path. The script will find it himself. The only thing that needs your attention is this: "${PROJECT_DIR}/GoogleService-Info.plist". Make sure that you indicate the correct path to your GoogleService-Info.plist file. Anyway, if anything goes wrong, there is a pretty descriptive error messages now from Firebase, and it is easy to fix this.Streetlight
I get an error: Running upload-symbols in Build Phase mode Validating build environment for Crashlytics... Validation succeeded. Exiting because upload-symbols was run in validation mode Fetching upload-symbols settings... [31merror: Could not fetch upload-symbols settings: Could not connect to the server.[0m Command PhaseScriptExecution failed with a nonzero exit codePrevision
The script works. The dSYM symbols get uploaded but still the crashes not getting decrypted in Firebase.Larry
@DiegoCarrera This is clear that you are facing some network issue as mentioned in this line ==> [31merror: Could not fetch upload-symbols settings: Could not connect to the server.Waw
@Larry Did you try uploading the same dSYM file using the manual method? Also, it takes some time to reflect crashes in the firebase console. Once you crashed the app, try relaunching it and then check the Firebase console.Waw
Firebase doesn't allow manual uploading anymore, I think. I couldn't fine an option to do that.Larry
@Larry I have added a NOTE on how to do manual upload in my answer. Did you check that? Do you have any reference to support this: "Firebase doesn't allow manual uploading anymore" ?Waw
When I add that to my script I am getting an error: GoogleService-Info.plist: Permission denied Command PhaseScriptExecution failed with a nonzero exit codeMarillin
@Marillin Please check if you have correct permissions to use GoogleService-Info.plist. Check your firebase project settings.Waw
@VishalSonawane even after adding the script , there are missing DSYm's at my firebase.Crofton
@iMinion, I also faced this issue and Firebase support replied that if your project has BitCode enabled then you need to manually download the dSYM from iTunes and then upload them. Try to do the same.Waw
do we have to do that everytime ? then what is the use of running the script . did u tried disabling the BitCodeCrofton
@Crofton I did not try with BitCode disabled, but according to Firebase team when Bitcode is enabled, apple creates different dSYM files and we need to download them and upload manually. I was in talks with their team and they were investigating further but I did not get any proper solution from them for Bitcode enabled projects. One solution they suggested is to use Fastlane for automation which I think is not the ideal one just to check logs.Waw
Solved the issue for me! Thanks Sir @VishalSonawanePaulettepauley
@MarkFernandez Glad, it helped you!Waw
The MOST disappointed thing is that Firebase Script example from inside Firebase panel tells us to call /upload-symbols script instead of /run and that was the cause of my headache for today.Holyhead
M
31

2020 FirebaseCrashlytics solution

You have two solutions :

1) From the command line

Go to your project folder and run :

./Pods/FirebaseCrashlytics/upload-symbols -gsp GoogleService-Info.plist -p ios <path_to_your_dsyms_zip>

You can get your dsym in Xcode organizer > right click on the archive > show in Finder -> Show content -> go to dsymm folder and compress it

2) From Xcode Build Phases

As described here (Firebase doc), you can add a Run Script phase in Xcode with this content :

"${PODS_ROOT}/FirebaseCrashlytics/run"

You also have to add these two input files under the run script :

${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}

and

$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

Mcginley answered 23/4, 2020 at 15:1 Comment(6)
This solution was the only one that worked for me - leaving out the path to the GoogleService-Info.plist file as shown above made it work.Emalia
Thanks man this works.... make sure to set Set the Debug Information Format setting to DWARF with dSYM File. else not dsym gets uploaded i thinkOestradiol
should i replace ${DWARF_DSYM_FOLDER_PATH}, ${DWARF_DSYM_FILE_NAME} or ${TARGET_NAME} with values? or Xcode know how to use this keys like it is?Senega
@AsiGivati you shouldn't need to change anythingMcginley
Thanks! In my case, worked adding $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) And for the dwarf: firebase.google.com/docs/crashlytics/…Cashman
Thank you so much for this. You saved my day!Cormier
N
22

After hours of struggling with this problem finally solved it using this approach:

use this command in Terminal: /path/to/pods/directory/FirebaseCrashlytics/upload-symbols -gsp /path/to/GoogleService-Info.plist -p ios /path/to/dSYMs

Important thing is instead of /path/to/pods/directory you should enter the path to your pods folder in your application folder, and instead of /path/to you should enter the path to the GoogleService-Info.plist which is in your project folder too. And the last one is, instead of /path/to/dSYMs you should enter the path to your archive which has the format of .xcarchive.

For finding the .xcarchive path, you should first archive your application, then go to XCode -> Organizer and select your build, then right click on it and select "Show in finder" and then right click on your .xcarchive file and select "Show package contents". This is it, you can copy this path and paste it instead of /path/to/dSYMs and then hit enter to start uploading to Firebase Crashlytics.

Check out this link for more information: Firebase Docs

Nonmetallic answered 5/4, 2020 at 18:57 Comment(7)
I have tried this solution but still showing the same (Required dsym files) in the firebase crashlytics console. Can you help me.Annadiana
And do we need to upload every dSYM file after archive?Annadiana
@MaheshNFC yes sure. What's the problem?Nonmetallic
Manually uploading debug information with every release, and hoping that it matches the compiled code? You don't see the problem with that? Wow.Mowry
@AndrewKoster You can always use another approaches too!Nonmetallic
I had an extra space in the command that was causing an issue!!Welfarism
Is there any way we can add proxy to this command? I have scenario where machine we are uploading script not enabled with internet.Fatherland
G
15

While implementing FirebaseCrashlytics(Currently is in beta) for Crashlytics

Add new run script from Build Phases and add the following :

"${PODS_ROOT}/FirebaseCrashlytics/run"

In Input Files sections add

${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}

and

$(SRCROOT)/path to/GoogleService-Info.plist

If you still get dSYM missing error then try to run from terminal

/path/to/pods/FirebaseCrashlytics/upload-symbols -gsp /path/to/GoogleService-Info.plist -p ios /path/to/dSYMs

For path to FirebaseCrashlytics and GoogleService-Info.plist drag and drop from the actual location For dSYMs path will be ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}

To get that hit the command with your project .xcodeproj and target xcodebuild -project YourProject.xcodeproj -target YourTarget -showBuildSettings
and replace your specific path

Please take note of the following while implementing Crashlytics
1. Run application in release mode
2. While testing disconnect device from mac
3. Set correct GoogleService-Info.plist
4. If you rename it, make sure you set the correct file name whenever required.

Giselagiselbert answered 14/4, 2020 at 11:54 Comment(2)
Why do you state that you need to Run application in release mode? You can enable DWARF with dSYM for Debug mode as well.Streetlight
@Streetlight Crashlytics records crash is in release mode that's why.Giselagiselbert
R
6

Believe me, I spent one day but nothing worked,

Surprisingly few solutions are working for a few projects for my colleagues but I'm using Big Sur & Xcode 12.2 nothing worked for me.

Tried 1: Each step mentioned in firebase doc.

Tried 2: Tried to upload symbol from terminal by passing path_to_pod_firebasecrshlytics/uploadsybol -gsp path_to/GoogleService-Info.plist -p ios path_to/dSYMs

But, No luck,

Following trick works for me,

Step 1: make sure you are on the latest firebase crashlytics version for it, give a path to project & fire cmd pod update

I was using Firebase Crashlytics version 4.0.0-beta.1 but after pod update it is 8.2.0

Step 2: Go to build phase add a run script bellow compile bundle resources "${PODS_ROOT}/FirebaseCrashlytics/run"

Step 3: Add DYSM Script, "${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/your_path/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Step 4: Build project;

Step 5: Run project & Stop or disconnect from storyboard

Step 6: Make crash 2-3 times & wait for 2-5 mins.

Cheers, All Set!

Rosariorosarium answered 2/7, 2021 at 9:0 Comment(2)
Everyone observe the your path in "${PROJECT_DIR}/your_path/GoogleService-Info.plist" -p iosEncapsulate
what does the run command do ? I have it in my build but I can't find it on the docsDerbent
P
5

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

I replaced my GoogleService-Info.plist in additional folder and made directory changes in shell script. Probably you should do the same

For terminal command you better drag and drop necessary file in terminal then copy selected path

/path_to_pods/FirebaseCrashlytics/upload-symbols -gsp /path_to_google_service/GoogleService-Info.plist -p iOS /path_to_dSYMs

Prochronism answered 24/3, 2020 at 9:4 Comment(0)
P
2

Hmm nothing worked for me but changing this:

"${PODS_ROOT}/FirebaseCrashlytics/run" 

to this:

"${PODS_ROOT}/FirebaseCrashlytics/run" -gsp "${PROJECT_DIR}/project_main_dir/google-services-files/iOS-GoogleService-Info.plist" 

EDIT:

for those of you trying to complie to iOS's Catalyst:

you don't have to download two different Google JSON files. You should use only one (cause you have only 1 target). IF you want to upload a mac version of your app, just go to App Store Connect and create a new release for OSX (in the same page of your app)

Paco answered 13/5, 2020 at 8:55 Comment(3)
After this do we need to run any code on terminal? or this one is enough ?Annadiana
This one was enough for mePaco
In my case its's still showing dSYM files missing. saying to upload them in crashlytics console.Annadiana
S
2

In my case none were working until I added this:

"${PODS_ROOT}/FirebaseCrashlytics/run" -gsp "${PROJECT_DIR}/intermediate_folders/GoogleService-Info.plist"

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

If I didn't add the path to the run command, the build phase would be running forever...

Smutty answered 29/6, 2020 at 11:53 Comment(0)
B
2

We can do:

PATH_TO_GOOGLE_PLISTS="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"

To get a reference to the plist

Then use it:

"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PATH_TO_GOOGLE_PLISTS}" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Bichloride answered 30/12, 2021 at 7:3 Comment(0)
F
1

Your Google Services path seems to be off. Here is an example of what my build phase looks like, which is able to successfully upload dSYM's. I suggest following these instructions one more time https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports-new-sdk?platform=ios&authuser=0.

find /Users/okodysh/Library/Developer/Xcode/DerivedData/myApp-ftqksfkpdvisbtaozpqzzjiizpfk/Build/Products/Debug-iphonesimulator -name "myApp.app.dSYM" | xargs -I {} $PODS_ROOT/FirebaseCrashlytics/upload-symbols -gsp /Users/okodysh/Desktop/iOSApps/myApp/myApp/GoogleService-Info.plist -p ios {}

Filibertofilibuster answered 24/3, 2020 at 14:19 Comment(0)
P
0

Check you FULL project folder path whether it contains space. I solve it by moving my project into another folder path that doesn't have space.

Proponent answered 5/3, 2021 at 13:8 Comment(0)
M
-1

//see project "granite"

error :

Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Processing dSYMs...
Command PhaseScriptExecution failed with a nonzero exit code



2023-04-25 22:08:31.703 upload-symbols[23280:103455] Unable to get file attributes for dSYM file at path "/Users/abdallahandroid/Library/Developer/Xcode/DerivedData/Runner-gefdrreutulmdwdzwzzvbbjmuntb/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/App.framework.dSYM/Contents/Resources/DWARF"
2023-04-25 22:08:32.709 upload-symbols[23280:103455] Unable to get file attributes for dSYM file at path "/Users/abdallahandroid/Library/Developer/Xcode/DerivedData/Runner-gefdrreutulmdwdzwzzvbbjmuntb/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/App.framework.dSYM/Contents/Resources/DWARF"
Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Processing dSYMs...

fixed:

1- update dependence packages of project

2- make your flutter version is last update stable version

3- update your mac and xcode to last version

4- flutter clean and pub get commands

5- now try again i hope i will archive your app now

Method answered 26/4, 2023 at 5:11 Comment(1)
You seem to posting your own issue and answer that has nothing to do with the original question.Chalaza

© 2022 - 2024 — McMap. All rights reserved.