本文介绍了iOS Firebase崩溃报告-运行构建脚本时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在运行脚本以上传符号文件时(每次尝试构建项目时),我都会收到以下错误消息:
I get the following error when running the script to upload symbol files (everytime I try and build my project):
这是我的构建脚本:
if [ "$CONFIGURATION" == "Debug" ]; then
GOOGLE_APP_ID=<app-id>
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey-Dev.json
else
GOOGLE_APP_ID=<app-id>
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey.json
fi
我已经完成/检查的事情:
Things I've done/checked:
-
GOOGLE_APP_ID
和CrashReportingKey*.json
与同一项目关联. - 我的
GoogleService-Info*.plist
文件具有API_KEY
字段. - 选中仅在安装时运行脚本"复选框,这使我可以运行该应用程序,但实际上并未在开发环境中运行该脚本.因此,崩溃会发送到Firebase,但不会被表示出来.
- The
GOOGLE_APP_ID
andCrashReportingKey*.json
are associated with the same project. - My
GoogleService-Info*.plist
files have theAPI_KEY
field. - Checking "Run script only when installing" box, which allows me to run the app, but doesn't actually run the script in a development environment. So crashes are sent to Firebase, but they aren't symbolicated.
我愿意接受任何想法.谢谢!
I'm open to any ideas. Thanks!
推荐答案
您是正确的,没有方法可以覆盖GoogleService-Info.plist.但是,仍然有一种方法可以覆盖该文件中上载脚本使用的信息.
You are correct that there's no way to override the GoogleService-Info.plist. However there's still a way to override the pieces of information the upload script uses from that file.
- 打开与.json对应的GoogleService-Info.plist.
- 搜索GOOGLE_APP_ID和API_KEY.
-
像这样调整构建脚本:
- Open the GoogleService-Info.plist corresponding to the .json.
- Search for GOOGLE_APP_ID and API_KEY.
Adjust the build script like so:
export FIREBASE_APP_ID=<GOOGLE_APP_ID>
export FIREBASE_API_KEY=<API_KEY>
"${PODS_ROOT}"/FirebaseCrash/upload-sym "ServiceAccount.json"
对于您而言,您的最终脚本应类似于:
In your case, your final script should look something like:
if [ "$CONFIGURATION" == "Debug" ]; then
export FIREBASE_APP_ID=<app-id>
export FIREBASE_API_KEY=<API_KEY for dev>
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey-Dev.json
else
export FIREBASE_APP_ID=<app-id>
export FIREBASE_API_KEY=<API_KEY for release>
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey.json
fi
这篇关于iOS Firebase崩溃报告-运行构建脚本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!