简体   繁体   English

FirebaseCrashlytics 不会为 iOS 模拟器编译

[英]FirebaseCrashlytics won't compile for iOS simulator

I'm trying to integrate FirebaseCrashlytics to replace Fabric / Crashlytics.我正在尝试集成 FirebaseCrashlytics 来替换 Fabric / Crashlytics。 So far, I've followed the steps in the docs and it all seems to be working on a device.到目前为止,我已经按照文档中的步骤进行操作,并且似乎都在设备上运行。 I'm able to simulate crashes and see the crashes in firebase.我能够模拟崩溃并查看 firebase 中的崩溃。 The issue is when I'm trying to build for the simulator, it won't compile.问题是当我尝试为模拟器构建时,它不会编译。 Does anyone know how to get around this?有谁知道如何解决这个问题?

I'm using Xcode 11.5 Installing through cocoapods via this document: https://firebase.google.com/docs/crashlytics/upgrade-sdk我正在使用 Xcode 11.5 通过 cocoapods 通过此文档进行安装: https://firebase.googlesgrade.com/docs/crashlytics

显示架构 x86_64 的未定义符号的错误

So, I've tried integrating via Carthage instead, and got the same result.因此,我尝试通过 Carthage 进行集成,并得到了相同的结果。 I did notice that those errors only appear when I try to use我确实注意到这些错误仅在我尝试使用时出现

Crashlytics.crashlytics().setUserID(userIdentifier)

or some Crashlytics.crashlytics() function calls.或一些Crashlytics.crashlytics() function 调用。

I did get the program to compile successfully and launching on the simulator via #if NDEBUG directives.我确实让程序成功编译并通过#if NDEBUG 指令在模拟器上启动。 So basically, whenever I needed to make use of Crashlytics.crashlytics(), I would put it inside #if NDEBUG and it works.所以基本上,每当我需要使用 Crashlytics.crashlytics() 时,我都会把它放在 #if NDEBUG 中并且它可以工作。

For example:例如:

#if NDEBUG
Crashlytics.crashlytics().setCustomValue("someValue", forKey: "someKey")
#endif

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM