Firebase上传符号文件构建错误:意外参数'ServiceAccount.json'

Joh*_*tty 8 ios firebase dsym firebase-crash-reporting

我正在尝试使用firebase实现崩溃报告.我按照这里文档.并将下载的子文件重命名为ServiceAccount.json.然后将其复制到项目目录.还改了剧本.现在我的构建阶段运行脚本看起来像

# 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"
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试构建项目时,它给出了构建错误

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

我的步骤有什么问题?

Abd*_*ich 22

这是我在练习项目中使用的脚本.

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
Run Code Online (Sandbox Code Playgroud)

如果您的JSON文件位于项目文件夹"XYZ"中,那么您只需要这个"JSON_FILE = $ {SRCROOT} /XYZ/ServiceAccount.json",或者如果它位于XYZ的子文件夹中,那么就像这样"JSON_FILE = $ {SRCROOT} /XYZ/subFolder/ServiceAccount.json"

并为您设置GOOGLE_APP_ID,就是这样.抱歉英语不好.希望能帮助到你 :)

  • 这是工作..但我没有得到为什么在文档中,它说传递json文件路径作为参数 (2认同)

Sah*_*oor 6

这适合我.刚刚"从Firebase文档中描述的方法中删除.

GOOGLE_APP_ID=1:**********:ios:************
"${PODS_ROOT}"/FirebaseCrash/upload-sym ${SRCROOT}/******/GoogleCrashKey.json
Run Code Online (Sandbox Code Playgroud)