本文介绍了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:

  1. GOOGLE_APP_IDCrashReportingKey*.json与同一项目关联.
  2. 我的GoogleService-Info*.plist文件具有API_KEY字段.
  3. 选中仅在安装时运行脚本"复选框,这使我可以运行该应用程序,但实际上并未在开发环境中运行该脚本.因此,崩溃会发送到Firebase,但不会被表示出来.
  1. The GOOGLE_APP_ID and CrashReportingKey*.json are associated with the same project.
  2. My GoogleService-Info*.plist files have the API_KEY field.
  3. 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.

  1. 打开与.json对应的GoogleService-Info.plist.
  2. 搜索GOOGLE_APP_ID和API_KEY.
  3. 像这样调整构建脚本:

  1. Open the GoogleService-Info.plist corresponding to the .json.
  2. Search for GOOGLE_APP_ID and API_KEY.
  3. 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崩溃报告-运行构建脚本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 15:13