Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase crashes out of the blue with "RepoExists" message

My Firebase project (iOS, written in Objective-C) was working fine until out of the blue, when launching the app on the simulator, it crashes and I get this message:

Terminating app due to uncaught exception 'RepoExists', reason: 'createRepo called for Repo that already exists.'

I've tried deleting the derived data, restarting Xcode, etc. but to no avail, I can't find anything about this crash on Stack Overflow, Google or the Firebase docs either. Does anyone have any ideas?

Thanks for the help.

like image 674
Echizzle Avatar asked Feb 20 '17 04:02

Echizzle


2 Answers

I moved the Database.database().ref() call to the main thread, solved the issue for me...

like image 108
Devous Avatar answered Nov 03 '22 15:11

Devous


I do this and it helped to solve my problem, I have FirebaseManager and there are two methods, one of them is the configure that I call in AppDelegate in didFinishLaunchingWithOptions. I also call createDatabase in configure

private func createDatabase() {
    _ = Database.database().reference()
}

After that, you can create a DatabaseReference in any other thread.

like image 23
Alexander Khitev Avatar answered Nov 03 '22 17:11

Alexander Khitev