Firebase Crashlytics:缺少dsym文件

6
我们已经从fabric.io迁移到Firebase,现在dsym文件总是丢失。这个手册试图帮助,但我真的不太理解:

手册:https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?authuser=0&platform=ios

那么我需要在构建阶段中实现哪一行代码才能自动完成呢?是这一行吗? find dSYM_directory -name "*.dSYM" | xargs -I {} $PODS_ROOT/Fabric/upload-symbols -gsp /path/to/GoogleService-Info.plist -p platform {}

但然后我的其他问题:我如何找到我的dsym_directory?而且我指的是每个构建都不同,对吧?而且它还说:

重要提示:如果您正在使用之前从Fabric链接到Firebase Crashlytics的应用程序,请传递您的Fabric API密钥以运行上传符号脚本。也就是说,在以下选项中运行脚本时,请使用-a fabric-api-key而不是-gsp path/to/GoogleService-Info.plist。

这是否意味着我可以使用变量fabric-api-key,还是需要精确替换为我的密钥?可以有人帮助我并给出我需要插入构建阶段的确切行吗?

1
从 https://firebase.google.com/docs/crashlytics/get-started?platform=ios: $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) 是你需要添加到构建阶段的输入字段中的内容。这个有帮助吗? - Kevin Kokomani
5个回答

10

2020年5月28日 enter image description here 对于我来说,直到dsym问题解决之前,我都会按照以下步骤进行操作。

首先,将Firebase Crashlytics添加到您的应用程序中:

打开为Firebase项目创建的podfile,并添加FirebaseCrashlytics pod

pod 'Firebase/Crashlytics'

pod 'Firebase/Analytics'

然后执行:pod install'

  1. 创建如图所示的两个脚本:

    在第一个脚本中编写下一个命令:

    "${PODS_ROOT}/FirebaseCrashlytics/run"

并在输入文件中添加这两个输入文件:

  • ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}

  • $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

enter image description here

在第二个脚本中编写下一个命令:

"find ${DWARF_DSYM_FOLDER_PATH}" -name "*.dSYM" | xargs -I \{\} "$PODS_ROOT/Fabric/upload-symbols" -gsp "$PODS_ROOT/../GoogleService-Info.plist" -p ios \{\}

输入图像描述

如果您第一次通过终端上传dSYM文件时遇到了问题,dSYM无法正常工作。


以下步骤说明如何将dSYM文件上传到Firebase:

  1. 从iTunes Connect下载.dSYMs: 输入图像描述
  2. 提取您从iTunes Connect下载的“appDsyms”文件夹。
  3. 通过终端运行脚本以上传dSYMs

/path-to-your-project/Pods/FirebaseCrashlytics/upload-symbols -gsp /path-to-GoogleService-Info.plist/GoogleService-Info.plist -p ios /path-to-appDsyms-folder/appDsyms

输入图像描述


我们需要为 /run/upload-symbols 都添加阶段脚本吗?在 Firebase 的指南中,他们只要求为 /run 添加构建阶段。 - Jibeex

6
在脚本之前,我使用find ${DWARF_DSYM_FOLDER_PATH}" -name "*.dSYM"来查找dsyms。
"find ${DWARF_DSYM_FOLDER_PATH}" -name "*.dSYM" | xargs -I \{\} "$PODS_ROOT/Fabric/upload-symbols" -gsp "$PODS_ROOT/../GoogleService-Info.plist" -p ios \{\}

enter image description here


你能发布一份完整的运行脚本清单吗?不确定是否还需要其他脚本。 - user3561494

4

对于那些在AppStoreConnect中没有找到活动的人。

从AppStoreConnect手动下载.dSYMs文件:

  • 登录AppStoreConnect
  • 选择我的应用程序(My Apps),然后选择您的应用程序enter image description here
  • 然后单击Testflight,再点击构建号(Build Number)enter image description here
  • 接着点击构建元数据(Build Metadata),在右下角可以看到Download dSYMs(下载dSYMs)enter image description here

4
Swift 5 如何上传dSYMs文件夹 3个简单步骤轻松上传dSYMs文件夹
代码:使用以下代码更改您的路径
/Users/Apple/Documents/OfficeProject/Ratainoo/retainoo-ios/Pods/FirebaseCrashlytics/upload-symbols -gsp /Users/Apple/Documents/OfficeProject/Ratal noo/retainoo-ios/Retainoo/GoogleService-Info.plist-pios/Users/Apple/Downloads/dSYMs

步骤1 从您的应用商店账户下载 输入图像描述

步骤2 输入路径 输入图像描述

步骤3 上传成功后

enter image description here


1

备用脚本以确保dsyn正确上传

  1. 进入“Build Phases”
  2. 在+ ->“NewRun Script Phase”中创建新脚本
  3. 检查它始终是最后一个
  4. 复制并粘贴此脚本
set -e

echo "info: Exec Upload dSYM"
#Path for google service .plist 
GOOGLE_SERVICE_INFO_PLIST="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}/GoogleService-Info.plist"
#Path for DSYM directory
DSYM_PATH="$DWARF_DSYM_FOLDER_PATH/dddd/$DWARF_DSYM_FILE_NAME"
#Firebase command script
CMD=""
if [[ ${PODS_ROOT} ]]; then
  echo "info: Exec FirebaseCrashlytics Run from Pods"
  CMD="$PODS_ROOT/FirebaseCrashlytics/upload-symbols"
else
  echo "info: Exec FirebaseCrashlytics Run from framework"
  CMD="$PROJECT_DIR/FirebaseCrashlytics.framework/upload-symbols"
fi

echo "info: Checking if .plist exists"
if [ -f "$GOOGLE_SERVICE_INFO_PLIST" ]; then
    echo "info: $GOOGLE_SERVICE_INFO_PLIST exists."
else 
    echo "ERROR: $GOOGLE_SERVICE_INFO_PLIST does not exist."
    exit 1
fi

echo "info: Checking if .dSYM"
if [ -d "$DSYM_PATH" ]; then
    echo "info: $DSYM_PATH exists."
else 
    echo "ERROR: $DSYM_PATH does not exist."
    echo "info: try fallback"
    DSYM_PATH=` find "${DWARF_DSYM_FOLDER_PATH}" -name "*.dSYM" | xargs `
    if [ -d "$DSYM_PATH" ]; then
        echo "info: $DSYM_PATH exists."
    else 
        echo "ERROR: $DSYM_PATH does not exist."
        exit 1
    fi
fi
echo "info: Check if upload-symbols script exists"
if [ -f "$CMD" ]; then
    echo "$CMD exists."
else 
    echo "ERROR: $CMD does not exist."
    exit 1
fi

echo "info: Starting command upload-symbols"
"${CMD}" -gsp "$GOOGLE_SERVICE_INFO_PLIST" -p ios "$DSYM_PATH" > /dev/null 2>&1 &
echo "info: Symbol uploading will proceed in the background."
echo "info: remove '> /dev/null 2>&1 &' to test in the main thread and see if there are any errors, or open console and filter with 'upload-symbols'"


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接