Johnykutty Johnykutty - 1 month ago 110
iOS Question

FirebaseCrash/upload-sym build error

I am trying to implement crash reporting with firebase. I followed the documentation here. And renamed the downloaded son file to

. Then copied it to project directory. Also changed the script. Now my build phase run script looks like

# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:.....#my app id

# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "ServiceAccount.json"

But when I try to build the project its giving build error

Unexpected argument 'ServiceAccount.json'
usage: /Users/<full path>/Pods/FirebaseCrash/upload-sym [-h] [-v] [-w|-e]
Command /bin/sh failed with exit code 2

Whats wrong with my steps?


This is the script I use in my practice project.


defaults write version -integer 1

JSON=$(cat "${JSON_FILE}")
/usr/bin/plutil -replace "app_${GOOGLE_APP_ID//:/_}" -json "${JSON}" "$HOME/Library/Preferences/"

If your JSON file is in the project folder "XYZ" then you only need this "JSON_FILE=${SRCROOT}/XYZ/ServiceAccount.json" or if it is in a subFolder of XYZ then like this "JSON_FILE=${SRCROOT}/XYZ/subFolder/ServiceAccount.json"

And set you GOOGLE_APP_ID and that is it. sorry for bad English. Hope It helps :)