App crashing when using Firebase Auth, reason: 'Default app has already been configured.'

前端 未结 9 1651
梦如初夏
梦如初夏 2020-12-13 23:34

I\'m building my first iOS application, and I am using Firebase to handle authentication, database, etc. I added a sign up screen and used the following code to create a new

相关标签:
9条回答
  • 2020-12-14 00:27

    just in case someone else stumble upon this problem. when use firebase sdk with googleSignIn sdk. you only have to configure them once. either do [[GGLContext sharedInstance] configureWithError: &configureError]; or [FIRApp configure]

    0 讨论(0)
  • 2020-12-14 00:27

    For Swift 4

    Had the same problem with crashing. When trying to reference from Firebase with a .plist file.

    (This fixed my problem.)

    Try writing this outside of or within the viewDidLoad method:

    1. var ref: DatabaseReference!
    

    Then reference it within the viewDidLoad method:

    2. Database.database().reference()
    

    And now it's:

    FirebaseApp.configure()
    

    Instead.

    0 讨论(0)
  • 2020-12-14 00:31

    You can call once in AppDelegate init method to configure.

    override init() {
       // Firebase Init
       FIRApp.configure()
    }
    
    0 讨论(0)
提交回复
热议问题