Firebase boot symbol file assembly failed: Unexpected argument 'ServiceAccount.json'

I am trying to implement crash reports using firebase. I followed the documentation here . And renamed the downloaded son file to ServiceAccount.json . Then copied it to the project directory. Also the script has changed. Now my phase of the build phase of the 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 a project, it gives a 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 

What is wrong with my steps?

+8
ios firebase firebase-crash-reporting dsym
source share
12 answers

This is the script that I use in my training 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 located in the "XYZ" project folder, you only need this "JSON_FILE = $ {SRCROOT} /XYZ/ServiceAccount.json", or if it is in the XYZ subfolder, then like this: "JSON_FILE = $ {} SRCROOT /XYZ/subFolder/ServiceAccount.json "

And set GOOGLE_APP_ID and that’s it. Sorry for the bad english. Hope this helps :)

+22
source share

This works for me. Just deleted " from the method described in the Firebase docs.

 GOOGLE_APP_ID=1:**********:ios:************ "${PODS_ROOT}"/FirebaseCrash/upload-sym ${SRCROOT}/******/GoogleCrashKey.json 
+6
source share

It seems that the upload-sym script has been modified to accept a single parameter with FirebaseCrash 1.0.7.

Check the version of your FirebaseCrash module on pod outdated and upgrade it if using an older one.

+3
source share

Abdul's solution worked for me, but I had to replace upload-sym with upload-sym-util.bash in the script, so it looked like this:

 JSON_FILE=${SRCROOT}/Pods/FirebaseCrash/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-util.bash 
+3
source share

Update : The latest FirebaseCrash fixed this, and usage is now different.

The instructions are incorrect. You need to manually create the PLIST file, but only ONCE. The following is my addition to the Abdul script:

 # Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file GOOGLE_APP_ID=1:*:iOS:* # Insert this code BETWEEN the GOOGLE_APP_ID declaration and the # call to FirebaseCrash/upload-sym, to generate PLIST file if needed # Note the PLIST_FILE location is hard-coded in firebase script, do not change PLIST_FILE="${HOME}/Library/Preferences/com.google.SymbolUpload.plist" # DO NOT CHANGE if [ ! -f "${PLIST_FILE}" ]; then JSON_FILE="${PODS_ROOT}/FirebaseSymbolUploadKey.json" # Change to location of your file defaults write com.google.SymbolUpload version -integer 1 # Required by script JSON=$(cat "${JSON_FILE}") /usr/bin/plutil -replace "app_${GOOGLE_APP_ID//:/_}" -json "${JSON}" "${PLIST_FILE}" fi # Instructions WRONG, don't pass any args, script hard-codes where it looks # for credentials, which is handled by the JSON conversion above "${PODS_ROOT}"/FirebaseCrash/upload-sym 
+2
source share

In my case, the script could not find "FirebaseCrash / upload-sym" because the Google article only recommends adding "Firebase / Core" to the Podfile.

And I added: 'Firebase/Crash' library, then it worked, I hope this help!

+2
source share

I just changed / FirebaseCrash / upload -sym to / FirebaseCrash / upload-sym-util.bash in my script, it worked

GOOGLE_APP_ID = 1: 1234567830: iOS: 7sjghd66373hbdd2 "$ {PODS_ROOT}" / FirebaseCrash / upload -sym-util.bash "/Users/iosteam/Documents/MYLES-iOS-a86994a092e8.json"

+2
source share

Last crash crash firebase-sym script can find the json service account without specifying any path, just put it in the same folder next to your xcproject Xcode file.

If you use CocoaPods, then something like this simple script works:

 GOOGLE_APP_ID=1:1234567890:ios:ab123cd456ef789 "${PODS_ROOT}"/FirebaseCrash/upload-sym crash-service-account.json 

If you don't want to load characters every time you start, use a script instead to reduce compilation time:

 if ["${CONFIGURATION}" != "Debug" ]; then GOOGLE_APP_ID=1:1234567890:ios:ab123cd456ef789 "${PODS_ROOT}"/FirebaseCrash/upload-sym crash-service-account.json fi 
+1
source share

I have FirebaseCrash 1.0.6. And my solution was just to use

 "${PODS_ROOT}"/FirebaseCrash/upload-sym 

without any parameters.

+1
source share

First: add to the ServiceAccount file ".json" -> ServiceAccount.json

and copy this file to the root folder of your project.

Second: install this code in the run script in the "Build Phases" section

 GOOGLE_APP_ID= copy here your "GOOGLE_APP_ID" from GoogleService-Info.plist "${PODS_ROOT}"/FirebaseCrash/upload-sym "${ROOT}"ServiceAccount.json 
  • note that GoogleService-Info.plist has "API_KEY"

    if you don’t go to firebase and download this file again.

0
source share

In my case, I followed all the same steps as the firebase alarm history report , but still I got the same ERROR. I later realized as soon as I implemented Google Analytics before Firebase Analytics and Crash Report in the same project. So I got a crash, for this I removed Google Analytics from the Podfile and reinstalled the pod pod install command in the terminal.

0
source share

I had the same error; caused by the fact that I add the upload-sym fragment to the Post-Action from the "Archive" instead of "Build"

But upload-sym does not work in the aftereffect archive. This requires environment variables that are only available in Build actions.

(ps I did not want it to load every time I created, every time I make an assembly for the AppStore.)

0
source share

All Articles