Crashlytics 集成问题 [英] Crashlytics integration issue

查看:22
本文介绍了Crashlytics 集成问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将 Crashlytics 集成到我的项目中.

I have trouble integrating Crashlytics into my project.

按照网站上的说明进行操作.但是在安装 Crashlytics mac 应用后不久,添加新的构建脚本、粘贴脚本,然后我构建我的项目以继续,然后应用崩溃了.

Having follow instruction on website. But soon after installing the Crashlytics mac app, add new build script, paste script, then I build my project to continue, then the app crashed.

更新:那时,我忘记在 AppDelegate 中初始化 Crashlytics 实例.这完全是我的错,不是服务也不是客户端应用程序(顺便说一句,这真的很棒!).您可以在下面看到答案.

Update: so back then, I forgot to initialize a Crashlytics instance in AppDelegate. It's totally my fault, not the service nor the client app (which is really really awesome by the way!). You can see answers below.

推荐答案

在目标的构建阶段中,单击右下角的 + 添加构建阶段按钮,然后选择添加运行脚本.在 Crashlytics mac 插件中,您应该获得一个运行脚本以复制到此运行脚本构建阶段.它看起来像这样:

In the Build Phases of your target, click the + Add a Build Phase button in the bottom right and select Add Run Script. In the Crashlytics mac plugin, you should be given a run script to copy into this run script build phase. It will look like this:

./Crashlytics.framework/run <your api key>

除了您的 api 密钥将是插件提供的 40 位数字.

Except your api key will be a 40 digit number provided by the plugin.

在您的应用委托中:

#import <Crashlytics/Crashlytics.h>

didFinishLaunchingWithOptions 中写入以下行以启动 Crashlytics 会话.

In didFinishLaunchingWithOptions write the following line to start your Crashlytics session.

[Crashlytics startWithAPIKey:<your api key>];

<您的 api 密钥> 与运行脚本中的数字相同.

<your api key> is the same number in the run script.

这篇关于Crashlytics 集成问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆