I am trying to implement crash reporting with firebase. I followed the documentation here. And renamed the downloaded son file to ServiceAccount.json
. 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.
JSON_FILE=${SRCROOT}/*****/ServiceAccount.json
GOOGLE_APP_ID=1:**********:ios:*********
defaults write com.google.SymbolUpload version -integer 1
JSON=$(cat "${JSON_FILE}")
/usr/bin/plutil -replace "app_${GOOGLE_APP_ID//:/_}" -json "${JSON}" "$HOME/Library/Preferences/com.google.SymbolUpload.plist"
"${PODS_ROOT}"/FirebaseCrash/upload-sym
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 :)
This works for me. Just removed "
from method described on Firebase docs.
GOOGLE_APP_ID=1:**********:ios:************
"${PODS_ROOT}"/FirebaseCrash/upload-sym ${SRCROOT}/******/GoogleCrashKey.json
It seems that upload-sym script has been changed to take one parameter since FirebaseCrash 1.0.7.
Check your FirebaseCrash pod version by pod outdated
and update it if you are using older one.
In my case, script could not find the 'FirebaseCrash/upload-sym' because the Google article only recommend us add 'Firebase/Core' to Podfile.
And i added: 'Firebase/Crash'
library then it worked, hope this help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With