1

I had just setup firebase in my app and tried to run it on my iOS device through Xcode, after a long wait the app got installed on my phone but wouldn't launch, the error shown was as follows -

Terminating app due to uncaught exception 'com.firebase.core', reason: 'Default app has already been configured.'

This is my AppDelegate.swift file -:

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    if FirebaseApp.app() == nil {
        FirebaseApp.configure()
    }
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

Please help me solve this, thanks in advance.

3
  • Please check this stackoverflow.com/questions/37910766/… Commented Dec 14, 2020 at 12:00
  • 1
    Having the same issue. Did you find a solution? Commented Mar 20, 2021 at 20:40
  • // Configure Firebase // ------------------ if FIRApp.defaultApp() == nil { FIRApp.configure() } Commented Mar 23, 2021 at 5:16

1 Answer 1

0

I was able to solve the issue by adding this line of code -

// Configure Firebase // ------------------ if FIRApp.defaultApp() == nil { FIRApp.configure() }

You can also check a similar issue for a detailed answer -

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.