我正在尝试使用 firebase 实现崩溃报告。我关注了documentation here .并将下载的子文件重命名为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"
但是当我尝试构建项目时出现构建错误
Unexpected argument 'ServiceAccount.json'
usage: /Users/<full path>/Pods/FirebaseCrash/upload-sym [-h] [-v] [-w|-e]
Command /bin/sh failed with exit code 2
我的步骤有什么问题吗?
最佳答案
这是我在练习项目中使用的脚本。
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
如果您的 JSON 文件在项目文件夹“XYZ”中,那么您只需要这个“JSON_FILE=${SRCROOT}/XYZ/ServiceAccount.json”,或者如果它在 XYZ 的子文件夹中,那么像这样“JSON_FILE=${SRCROOT}/XYZ/subFolder/ServiceAccount.json”
然后设置您的 GOOGLE_APP_ID 即可。 抱歉英语不好。希望对您有所帮助:)
关于ios - Firebase 上传符号文件构建错误 : Unexpected argument 'ServiceAccount.json' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39210860/