FirebaseApp.configure()在全新安装后第二次启动时崩溃

问题描述 投票:-1回答:1

我正在我的应用程序内部使用Firebase并在FirebaseApp.configure()内部调用didFinishLaunchingWithOptions。现在,当我执行全新安装(删除应用程序并再次安装)并首次运行时,我的应用程序可以正常运行。但是,当我第二次重新运行该应用程序时,它在FirebaseApp.configure()上使用

崩溃
2019-11-11 12:02:43.166729+0530 MyAppName[885:135491] 6.11.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled 
2019-11-11 12:02:43.176694+0530 MyAppName[885:135418] -[FIRInstanceIDTokenInfo isFresh]: unrecognized selector sent to instance 0x281bc8a80
2019-11-11 12:02:43.179909+0530 MyAppName[885:135418] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FIRInstanceIDTokenInfo isFresh]: unrecognized selector sent to instance 0x281bc8a80'
*** First throw call stack:
(0x1a267180c 0x1a2399fa4 0x1a257536c 0x1a2675c88 0x1a2677a6c 0x102e632fc 0x102e48844 0x102e48714 0x102e48530 0x102986b70 0x102986e0c 0x1029869e4 0x1029811dc 0x102980c18 0x102980b64 0x10264ea14 0x10264e7d4 0x10264eb7c 0x1a66d0ef4 0x1a66d2d20 0x1a66d8554 0x1a5ea6cdc 0x1a633bfc4 0x1a5ea77c4 0x1a5ea721c 0x1a5ea75f0 0x1a5ea6eac 0x1a5eab3c8 0x1a626e6a4 0x1a63555b0 0x1a5eab100 0x1a63554ac 0x1a5eaaf6c 0x1a5d1cba4 0x1a5d1b70c 0x1a5d1c8dc 0x1a66d68d4 0x1a628f09c 0x1a7776850 0x1a779b8e8 0x1a7780fb4 0x1a779b5a4 0x107b1abd8 0x107b1dffc 0x1a77c04c8 0x1a77c0194 0x1a77c06bc 0x1a25ef7c4 0x1a25ef71c 0x1a25eeeb4 0x1a25ea000 0x1a25e98a0 0x1ac541328 0x1a66da768 0x102654b44 0x1a2474360)
libc++abi.dylib: terminating with uncaught exception of type NSException

要设置firebase,我正在使用以下内容

private func setupFirebase() {    
    FirebaseApp.configure()    
    Messaging.messaging().delegate = self
}

我正在使用Cocoapods进行安装,而我正在使用的Firebase版本是6.11.0

ios swift firebase
1个回答
0
投票

尝试一下,稍有延迟

    DispatchQueue.main.asyncAfter(deadline: .now() + 40) {
        FirebaseApp.configure()
    }
© www.soinside.com 2019 - 2024. All rights reserved.