Swift 应用程序在运行 Firebase 2 秒后崩溃

问题描述 投票:0回答:1

我最近将我的 Macbook 换成了一台较新的 Macbook(如果有帮助的话,那就是 M1),并将主要由 SwiftUI 和 Firebase 组成的 iOS 应用程序转移到 GitHub,除了 cocoapods,我后来在计算机中安装了 cocoapods 以获取 Firebase 服务。

问题是,运行我的应用程序后,模拟器会在 2 - 5 秒后崩溃,并打印以下错误:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBLPromise HTTPBody]: unrecognized selector sent to instance 0x6000021be3a0'

我会在帖子中添加更多代码,但我不知道是什么原因造成的。

swift xcode firebase mobile
1个回答
0
投票

作为一项

crashPrevent
措施,您可以

  1. 向 NSObject 添加类别(objc)或扩展(swift)
  2. 命名方法名称
    HTTPBody
  3. 如果
    FBLPromise
    NSObject
    的子类,你将有一个后备方法

希望这对某些人有用✌🏻

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.