Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase upload symbol files build error: Unexpected argument 'ServiceAccount.json'

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?

like image 309
Johnykutty Avatar asked Aug 29 '16 16:08

Johnykutty


4 Answers

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 :)

like image 176
Abdul Rehman Avatar answered Nov 19 '22 13:11

Abdul Rehman


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
like image 20
Sahil Kapoor Avatar answered Nov 19 '22 14:11

Sahil Kapoor


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.

like image 3
Hiron Avatar answered Nov 19 '22 14:11

Hiron


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!

like image 3
ChenHuang Avatar answered Nov 19 '22 15:11

ChenHuang