[Firebase/Core][I-COR000003] 尚未配置默认 Firebase 应用

Paw*_*ski 5 ios firebase

我已在我的本机 iOS Swift/ObjC 应用程序中安装了这三个 pod:

pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Analytics'
Run Code Online (Sandbox Code Playgroud)

这是配置方法的调用:

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

我在日志中有这样的消息:

[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 ....
Run Code Online (Sandbox Code Playgroud)

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

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

Xcode 版本11.2.1 (11B500)

Pau*_*ien 0

+load如果应用程序在or方法中调用 Firebase API,则可能会发生这种情况+initialize。更多详细信息请访问/sf/answers/1679449971/