App closes on startup on Flutter (iOS) with Firebase with out giving any error

200 Views Asked by At

The application is working fine on android, however, when I am opening the application on iOS, it crashes instantly without giving any error.

1

There are 1 best solutions below

0
On

I solved this problem just by moving below line at the top of the function.

FirebaseApp.configure()

Put the above line as the first instruction in the didFinishLaunchingWithOptions method. Like below.

override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    FirebaseApp.configure()
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }