如何修复Firebase SIGABRT崩溃的iOS [英] How to fix Firebase SIGABRT crash iOS

查看:208
本文介绍了如何修复Firebase SIGABRT崩溃的iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了'Firebase / Database'和'Firebase / Auth'吊舱,并在AppDelegate didFinishLaunchingWithOptions中添加了FirebaseApp.configure()。该应用程序现在可以正常运行,但是当我输入
var ref:Datab = Database.database()。reference()并运行时,该应用程序崩溃了。

I have installed 'Firebase/Database' 'Firebase/Auth' pods and I added FirebaseApp.configure() in AppDelegate didFinishLaunchingWithOptions. The app is fine now but when I enter var ref: Datab = Database.database().reference() and run, the app is crashing.

控制台:-

2017-10-16 15:57:06.876363 + 0530 TKT教堂[4106:1807608] *由于未捕获的异常'FIRAppNotConfigured'而终止应用程序,原因:无法获取默认的Firebase数据库实例。在使用Firebase数据库之前,必须调用 [FIRApp配置] (在Swift中为 FirebaseApp.configure())。'$ b $的b * 首先掷调用堆栈:
(0x1842e3d38 0x1837f8528 0x1842e3c80 0x102e88fcc 0x102dec660 0x102dec830 0x18dc7a8bc 0x18de23588 0x18de23700 0x18de232c0 0x18da59ebc 0x18da95fe8 0x18de23588 0x18de23700 0x18de232c0 0x18da59ebc 0x18da7650c 0x18de23588 0x18de232c0 0x18dc7a560 0x18de23588 0x18de23700 0x18de232c0 0x18dc798a0 0x18dff67f0 0x18d95c8dc 0x18d762cdc 0x18d95b5c0 0x18dbe9454 0x18deb91f0 0x18dbe90b8 0x18dbe9928 0x18e3526e8 0x18e35258c 0x18e0ce9c0 0x18e263fc8 0x18e0ce870 0x18deb8850 0x18d959e28 0x18dd5d6ec 0x186985768 0x18698e070 0x1041dd45c 0x1041e9b74 0x1869b9a04 0x1869b96a8 0x1869b9c44 0x18428c358 0x18428c2d8 0x18428bb60 0x184289738 0x1841aa2d8 0x18603bf84 0x18d757880 0x102dea3b0 0x183cce56c)
的libc ++ abi.dylib:与类型$ NSException的未捕获的异常终止b $ b(LLDB)

2017-10-16 15:57:06.876363+0530 TKT Church[4106:1807608] * Terminating app due to uncaught exception 'FIRAppNotConfigured', reason: 'Failed to get default Firebase Database instance. Must call [FIRApp configure] (FirebaseApp.configure() in Swift) before using Firebase Database.' * First throw call stack: (0x1842e3d38 0x1837f8528 0x1842e3c80 0x102e88fcc 0x102dec660 0x102dec830 0x18dc7a8bc 0x18de23588 0x18de23700 0x18de232c0 0x18da59ebc 0x18da95fe8 0x18de23588 0x18de23700 0x18de232c0 0x18da59ebc 0x18da7650c 0x18de23588 0x18de232c0 0x18dc7a560 0x18de23588 0x18de23700 0x18de232c0 0x18dc798a0 0x18dff67f0 0x18d95c8dc 0x18d762cdc 0x18d95b5c0 0x18dbe9454 0x18deb91f0 0x18dbe90b8 0x18dbe9928 0x18e3526e8 0x18e35258c 0x18e0ce9c0 0x18e263fc8 0x18e0ce870 0x18deb8850 0x18d959e28 0x18dd5d6ec 0x186985768 0x18698e070 0x1041dd45c 0x1041e9b74 0x1869b9a04 0x1869b96a8 0x1869b9c44 0x18428c358 0x18428c2d8 0x18428bb60 0x184289738 0x1841aa2d8 0x18603bf84 0x18d757880 0x102dea3b0 0x183cce56c) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

推荐答案

首先配置Fireb aseApp共享实例,然后创建对数据库的引用。

First Configure a FirebaseApp shared instance and then create a reference to your database.

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  FIRApp.configure()
  var ref: DatabaseReference!
  ref = Database.database().reference()
  return true 
}

这篇关于如何修复Firebase SIGABRT崩溃的iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆