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

前端 未结 9 1676
梦如初夏
梦如初夏 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

    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.

提交回复
热议问题