xcode Crashlytics 在发布模式下不报告崩溃

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33404777/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:07:57  来源:igfitidea点击:

Crashlytics not reporting crash in Release mode

iosxcodetestflightcrashlytics

提问by Murray Sagal

Crashlytics has been installed in the app in question for a couple of releases now. It's been working great.

Crashlytics 已经安装在有问题的应用程序中,现在已经有几个版本了。它工作得很好。

But as we prepare the next release Crashlytics has stopped reporting crashes in Release mode. Here are the things I can think of that have changed since our last release.

但在我们准备下一个版本时,Crashlytics 已停止在发布模式下报告崩溃。以下是我能想到的自上次发布以来发生的变化。

  • Xcode 7.1. The last release was prepared with Xcode 6.
  • We upgraded to Fabric.
  • We're testing the app on iOS 9.1.
  • Xcode 7.1。最后一个版本是用 Xcode 6 准备的。
  • 我们升级到 Fabric。
  • 我们正在 iOS 9.1 上测试该应用程序。

Anyway, with all those changes crashes are still being reported just fine in Debug. Just not in Release (installing from TestFlight after archiving and uploading to iTunes Connect).

无论如何,在所有这些更改中,在 Debug 中仍然可以正常报告崩溃。只是不在 Release 中(在存档并上传到 iTunes Connect 后从 TestFlight 安装)。

Here are the things I've checked:

以下是我检查过的内容:

  • On the Fabric site the app is there, the version and build are there. When I click on Missing DSYMs it tells me there are none missing.

  • startWithAPIKeyis being called in didFinishLaunchingWithOptions(added after trojanfoe's question).

  • The api key is correct. Checked and double-checked.

  • In the build script there isn't (and never was) a distinction between Debug and Release. It looks like this:

  • 在 Fabric 站点上,应用程序在那里,版本和构建都在那里。当我点击 Missing DSYMs 时,它告诉我没有丢失。

  • startWithAPIKey正在被调用didFinishLaunchingWithOptions(在 trojanfoe 的问题之后添加)。

  • api 密钥是正确的。检查和双重检查。

  • 在构建脚本中,Debug 和 Release 之间没有(也从来没有)区别。它看起来像这样:

enter image description here

在此处输入图片说明

  • In Build Settings DEBUG_INFORMATION_FORMATis already set to DWARF with dSYM File(added after StormXX's question):
  • 在 Build SettingsDEBUG_INFORMATION_FORMAT中已经设置为DWARF with dSYM File(在 StormXX 的问题之后添加):

enter image description here

在此处输入图片说明

What am I missing?

我错过了什么?

采纳答案by Mike Bonnell

Mike from Crashlytics and Fabric here.

来自 Crashlytics 和 Fabric 的 Mike。

With Fabric, the initialization of Crashlytics did change slightly. Using the following code should work (Obj-C):

使用 Fabric,Crashlytics 的初始化确实略有变化。使用以下代码应该可以工作(Obj-C):

#import "AppDelegate.h"
#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>

@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [Crashlytics startWithAPIKey:@"YourAPIKey"];
    // You can comment out the above line if you have your Twitter Fabric API key in your info.plist.
    [Fabric with:@[[Crashlytics class]]];
    return YES;
}

Updating the run script build phase to the following is also recommended:

还建议将运行脚本构建阶段更新为以下内容:

./Fabric.framework/run <YourAPIKey> <YourBuildSecret> 

回答by upperlacon

I was also facing this issue. My apps DSYMs files were not being automatically uploaded to Fabric as had previously been the case. The root cause was found to be that xcode 7.1 had defaulted the project to bitcode enabled = YES

我也面临这个问题。我的应用程序 DSYM 文件没有像以前那样自动上传到 Fabric。发现根本原因是xcode 7.1默认项目为bitcode enabled = YES

Setting Bitcode enabled = NO in my Build Settings fixed the auto upload issue.

在我的构建设置中设置 Bitcode enabled = NO 修复了自动上传问题。

From Fabrics advanced set up document:

来自 Fabrics 高级设置文档

Bitcode enabled applications are required to download their dSYM from Xcode and then upload it to Crashlytics so that we can symbolicate the crashes.

启用 Bitcode 的应用程序需要从 Xcode 下载它们的 dSYM,然后将其上传到 Crashlytics,以便我们可以对崩溃进行符号化。

回答by StormXX

I met the same problem and I sovle it... Check your project's Build Setting , find Debug Information Format. change it to DWARF with dSYM File

我遇到了同样的问题,我解决了它...检查您项目的 Build Setting ,找到Debug Information Format使用 dSYM 文件将其更改为DWARF

Image

图片

回答by Nik Kov

For me didn't help uploading dsym files from .xcarchive. Only when i've downloaded zip dSYM archive from the iTunesConnectand uploaded it to fabric- it make sense.

对我来说,从 .xcarchive 上传 dsym 文件没有帮助。只有当我从iTunesConnect下载 zip dSYM 存档并将其上传到结构时-这才有意义。

enter image description hereenter image description here

在此处输入图片说明在此处输入图片说明

回答by Prashant Gaikwad

In my case, it was totally a different issue. Earlier I was getting all the crash reports perfectly but then due to some reasons, I have to update my bundle id of the project.

就我而言,这是一个完全不同的问题。早些时候,我完美地获得了所有崩溃报告,但后来由于某些原因,我必须更新我的项目包 ID。

So If you update your bundle id then the project you have created on Fabric will not receive crash reports since you need to create one new project for that new bundle id.

因此,如果您更新捆绑包 ID,那么您在 Fabric 上创建的项目将不会收到崩溃报告,因为您需要为该新捆绑包 ID 创建一个新项目。

Important: If bundle id is differenton your fabric app then you will never receive any crash reports.

重要提示:如果您的 Fabric 应用程序上的bundle id 不同,那么您将永远不会收到任何崩溃报告。

Tip: Create your projects in Fabric using the Fabric desktop application.

提示:使用 Fabric 桌面应用程序在 Fabric 中创建项目。