【问题标题】:[Firebase/Core][I-COR000003] The default Firebase app has not yet been configured[Firebase/Core][I-COR000003] 尚未配置默认 Firebase 应用
【发布时间】:2020-04-02 08:28:41
【问题描述】:

我已经在我的原生 iOS Swift/ObjC App 中安装了这三个 pod:

pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'

这里是配置方法的调用:

func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
    FirebaseApp.configure()
    return true
}

我在日志中有这条消息:

[Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https ....

我不知道问题出在哪里。我在 Internet 上看到类似的情况,但与以下技术相关:React Native、Cordova、Flutter ... 有人知道我的原生项目中发生了什么吗?

我在控制台中仔细检查了 Google Info Plist 文件和配置,我以前从未遇到过此类行为。

Xcode 版本 11.2.1 (11B500)

【问题讨论】:

  • 我遇到了同样的问题,但可以找到解决方案

标签: ios firebase


【解决方案1】:

如果应用在 +load+initialize 方法中调用 Firebase API,则可能会发生这种情况。更多详情https://stackoverflow.com/a/23992142/556617

【讨论】:

  • 不。我在application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool 有配置
【解决方案2】:

这个解决方案对我有用 https://stackoverflow.com/a/64046033/9682885

只需在您的 AppDelegate 中添加这一行

FirebaseApp.configure()

【讨论】:

  • 这不正是 OP 正在做的事情吗?
猜你喜欢
  • 2022-11-28
  • 1970-01-01
  • 1970-01-01
  • 2018-12-01
  • 1970-01-01
  • 2016-09-16
  • 2019-11-09
  • 2021-09-22
  • 2018-01-15
相关资源
最近更新 更多