gpt4 book ai didi

objective-c - Fabric 和 Objective C 中多个目标上缺少 DYSM 错误

转载 作者:行者123 更新时间:2023-12-04 03:04:55 24 4
gpt4 key购买 nike

在我的应用中有两个目标:

 Target 1 : MyApp - com.app.myapp
Target 2 : MyAppQA - com.app.myappQa

用于 Fabric 注册的电子邮件 ID 对于两个目标都是 相同的

我使用 Fabric mac app 创建了两个应用。

MyApp 中,Target Fabric 捕获了所有崩溃并且工作正常。但是当我使用目标 MyAppQA 运行时,我得到了 Missing DYSM file error.

enter image description here

我不明白为什么我的第二个目标没有捕获到崩溃。

这是我试过的方法:

  1. BitCode - 已禁用(虽然我没有使用 bitcode 但即便如此我也进行了交叉检查)

  2. 调试信息格式 - 使用 dSYM 文件设置为 DWARF(发布和调试)

  3. 尝试手动上传 DYSM 文件(我通过存档项目然后从右键单击菜单中选择 ShowPackageContents 获得了 dysm 文件)

我已经尝试了互联网上所有可能的解决方案。而且我不想手动更新 dysm,因为我现在没有 iTunesConnect 帐户。

最佳答案

集成 Crashlytics 的步骤:-

1.添加 cocoa pod

pod 'Fabric'
pod 'Crashlytics'

2.将运行脚本添加到构建阶段(对于此步骤,您必须登录 fabric 才能获取 API key )

"${PODS_ROOT}/Fabric/run" 8252525b24e2d6fagsdg101ea7faf49edefa84ff3ec342b0dgsdrergadc2bd8agsdg50671jhga2ee8c017ddgsdg33fbbb

3.将您的 API key 添加到 info.plist 文件中

 <key>Fabric</key>
<dict>
<key>APIKey</key>
<string>your_key</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>

4.在AppDelegate文件中添加如下代码

AppDelegate.h:-

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

AppDelegate.m:-

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Fabric with:@[[Crashlytics class]]]
}

5.为了强制崩溃,在 View Controller 的任何按钮点击事件上写下面的代码,不能写入应用委托(delegate)文件

[[Crashlytics sharedInstance] crash];

6.更改build设置:

 click on project target >>   Build setting >>  Chnage value of “Debug information Format” set it to “DWARF with dSYM file”
click on project >> Build setting >> Chnage value of “Debug information Format” set it to “DWARF with dSYM file”

7.如何让应用崩溃

 Xcode's debugger prevents us from processing crash reports. 

To make sure a crash is reported during your simulator testing:
⁃ Launch simulator (Run your project and install app in simulator)
⁃ Press stop (stop from Xcode )
⁃ Launch your app and force a crash (Now do not run project, just open simulator and launch your app from simulator and press button that u write code for crash ` [[Crashlytics sharedInstance] crash];`)
⁃ Relaunch the app from simulator (again run app from simulator not from Xcode project)
⁃ See the crash report in the web dashboard

关于objective-c - Fabric 和 Objective C 中多个目标上缺少 DYSM 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38825229/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com