ios - Firebase 上传符号文件构建错误 : Unexpected argument 'ServiceAccount.json'

标签 ios firebase firebase-crash-reporting dsym

我正在尝试使用 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/

相关文章:

ios - UICollectionView 中的两个 UITableView 使用相同的引用?

ios - firebase 在激活 iOS 应用程序时询问 key ID

ios - 导入此版本时出错

ios - CIFilter 中的 CIQRCodeGenerator 问题

swift - 无法将文本字段的值设置为 Firebase 搜索结果 - Swift

java - 如何将一个屏幕中生成的ID推送到另一个屏幕(不是紧邻生成iD的屏幕之后的屏幕)?

android - 为构建变体动态定义 FirebaseServiceAccountFilePath

ios - Firebase iOS 崩溃报告可读性问题

flutter - 在 flutter 中使用 try/catch 时 firebase_crashlytics 是否有效?

ios - 有什么方法可以从 LiDAR iOS14 导出点云数据?