The default app has not been configured yet

后端 未结 9 1576
予麋鹿
予麋鹿 2020-12-02 19:59

I\'m trying to upgrade my app to the new version of Firebase. I went through the setup guide and edited all of my code to match the new syntax. However, when I run the app,

9条回答
  •  伪装坚强ぢ
    2020-12-02 20:48

    I'm also using Fabric and in my case it was the order of Fabric and Firebase initializations. I had to initialize Firebase first.

    So changing

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        Fabric.with([Crashlytics.self])
        FirebaseApp.configure()
        ...
    }
    

    to:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        FirebaseApp.configure()
        Fabric.with([Crashlytics.self])
        ...
    }
    

    fixed the problem.

提交回复
热议问题