Swift 3到Swift 4:必须配置FirebaseApp(当它是)

时间:2017-11-09 00:09:12

标签: ios swift

这是错误:

2017-11-08 21:56:14.897695-0200 htchhkr-development[4861:265024] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The default FIRApp instance must be configured before the default FIRAuthinstance can be initialized. One way to ensure that is to call `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) in the App Delegate's `application:didFinishLaunchingWithOptions:` (`application(_:didFinishLaunchingWithOptions:)` in Swift).'

这是它加载的地方:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    FirebaseApp.configure()

FirebaseApp用作FIRApp,但Swift轻轻地告诉我,它不再称为FIRApp,而是FirebaseApp。我重命名了,但现在我收到了这个错误。

这里做什么?

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。我迁移到swift 4并运行我的程序并得到了同样的错误。然后我在终端中运行了pod更新,这似乎解决了我的问题。