gpt4 book ai didi

ios - 未配置 Firebase 应用

转载 作者:可可西里 更新时间:2023-11-01 03:01:25 32 4
gpt4 key购买 nike

这是随机开始发生的,我无法通过它。我的应用程序在调试区域启动时崩溃。

2016-10-29 14:31:57.606 gigMe[2285:73317] Firebase automatic screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO in the Info.plist

2016-10-29 14:31:57.783 gigMe[2285] [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure] to your application initialization. Read more: gives google address that i cant post on here

2016-10-29 14:31:57.911 gigMe[2285:73317] * Terminating app due to uncaught exception 'FIRAppNotConfigured', reason: 'Failed to get default FIRDatabase instance. Must call FIRApp.configure() before using FIRDatabase.' * First throw call stack:

我真的一点都不明白,因为我没有弄乱任何与数据库有关的事情,这是我的didFinishLaunchingWithOptions 方法:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print("wtf")
FIRApp.configure()

return true
}

我也没有在调试器中打印任何内容。有人知道发生了什么吗?

最佳答案

这不是 FIRApp.configure() 错误。您可能会在您的任何类中声明一个具有某些类函数的全局变量,例如

class viewCon : UIViewController{

let ref = FIRDatabase.database().reference() // or a Storage reference
// This might be the error
}

发生这种情况的原因是,您正在尝试使用类函数/属性初始化变量,而该类函数/属性可能尚未配置。所以试试这个:-

 class viewCon : UIViewController{

let ref : FIRDatabaseReference!
// This might be the error or a Storage reference

override func viewDidLoad(){

super.viewDidLoad()
ref = FIRDatabase.database().reference()
}
}

为了支持上述理论,尝试在 let ref = FIRDatabase.database().reference()FIRApp.configure() 上使用断点,看看哪一个得到先叫。如果 let ref = FIRDatabase.database().reference() 首先被调用,你一定会遇到这个错误,因为 ref 正在尝试访问尚未配置的 FIRDatabase 类..

关于ios - 未配置 Firebase 应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40322481/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com