No Firebase App '[DEFAULT]' Has Been Created in Flutter? 6 Causes and Fixes (2026)

By · Published 2026-11-16 · Last verified 2026-11-16

Why does Flutter say "No Firebase App '[DEFAULT]' has been created"?

Because some Firebase code ran before Firebase.initializeApp() had finished, or ran somewhere it was never called at all. The full message is [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp(). Firebase's Flutter setup guide shows the required order: WidgetsFlutterBinding.ensureInitialized(), then await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform), then runApp(). This guide covers the six situations where that order breaks, with the fix for each, checked against the Firebase documentation (last updated 2026-11-12) on 2026-11-16.

GSPTeck is giosaia's indie studio building mobile and web apps with Flutter and Firebase, and this is the error we see first whenever a new Firebase product, entry point or isolate is added to an app.

Grid of six causes of the Flutter error No Firebase App DEFAULT has been created: initializeApp not awaited, a service using Firebase too early, a background isolate, another entry point, a stale firebase_options file and tests without native Firebase
Six causes of the no-app error in Flutter.

The 6 causes at a glance

Match your symptom to a row first; the fix usually takes under ten minutes.

#CauseTypical symptomFix
1initializeApp never called, or not awaitedError on the first Firebase call at launchAwait it in main() before runApp()
2Something uses Firebase before main() finishesError from a service, provider or global fieldCreate those objects after initialisation
3Background message handler runs in its own isolatePush works in foreground, crashes in backgroundCall initializeApp inside the handler
4Another entry point skips your setupWorks with one run target, fails with anotherShare one bootstrap() function
5Stale or missing firebase_options.dartFails on one platform onlyRe-run flutterfire configure
6Tests run with no native FirebasePasses on a device, fails in flutter testPut Firebase behind your own interface and fake it

1. Did you call and await Firebase.initializeApp() before runApp()?

Probably not, if the error appears on the very first Firebase call. Firebase's setup guide initialises in main(), awaits the call, and only then starts the app, which means main has to be async.

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  runApp(const MyApp());
}

Two details cause most of the damage here. Forgetting await lets runApp() start while initialisation is still running. And putting the call inside a widget's initState is too late for any code that runs earlier in the tree. Initialise once, at the top, and never per screen.

2. Is a service, provider or global field touching Firebase too early?

Often yes, when the error points at a line that isn't in main(). A field like final db = FirebaseFirestore.instance; at file level, or a dependency-injection container that builds repositories at import time, runs before initializeApp completes.

If the next error you meet is permission-denied rather than no-app, initialisation is fixed and the problem has moved to your rules; our Firestore permission denied guide for Flutter picks up from there.

3. Does your background message handler initialise Firebase itself?

It must. Firebase's Flutter messaging guide says a background handler runs in its own isolate (on Android; iOS and macOS don't need a separate isolate), outside your app's context, so Firebase isn't initialised there until you do it.

Rule from the Firebase guideWhat to do
Not an anonymous functionDeclare a named function
Top-level functionNot a class method that needs initialisation
Flutter 3.3.0 or higherAnnotate with @pragma('vm:entry-point') so release builds don't strip it
Using other Firebase servicesCall await Firebase.initializeApp() first inside the handler
Long workFinish fast; the guide says tasks over 30 seconds may get the process killed

The handler also can't update app state or UI, because it isn't in the app's isolate. For token handling and delivery problems after this is fixed, see our FCM token hygiene guide.

Two columns comparing a main function that starts the app before Firebase is initialised, which fails, with one that ensures bindings, awaits Firebase.initializeApp and then calls runApp, which passes
Initialise Firebase before runApp, and await it.

4. Does every entry point run the same setup?

Only the entry point you run executes its own main(). If you build flavors with flutter run -t lib/main_dev.dart, or have a second entry for a widget, test harness or tool, each one needs the initialisation.

Move the shared steps into one bootstrap() function that does WidgetsFlutterBinding.ensureInitialized() and Firebase.initializeApp(...), and call it from every main_*.dart. If a staging build behaves differently from production because of App Check or project settings, our App Check staging guide explains that separate problem.

5. Is firebase_options.dart current for this platform?

Re-run flutterfire configure if the error or a related exception appears on only one platform. Firebase's guide says the command selects the platforms you support, creates a Firebase app for each, and writes firebase_options.dart, and that you need to re-run it whenever you start supporting a new platform or start using a new Firebase product, especially Google sign-in, Crashlytics, Performance Monitoring or Realtime Database.

The file holds unique but non-secret identifiers per platform, so it is safe to commit. If you use the Firebase Emulator Suite with a demo project, initialise with Firebase.initializeApp(demoProjectId: "demo-project-id"), where the ID starts with demo-, as the same guide describes. After changing configuration, do a full rebuild with flutter run, not a hot reload, because native configuration is read at launch. If Crashlytics reports nothing after the fix, our Crashlytics troubleshooting guide covers the next checks.

6. Do your tests run without native Firebase?

They do, which is why the same code that works on a device throws in flutter test. Unit and widget tests run on the Dart VM, with no native Firebase SDK behind FirebaseAuth.instance, so the first call fails with the same no-app error.

The reliable fix is architectural: wrap Firebase behind a small interface in your own code, inject a fake in tests, and keep real Firebase calls in the thin layer you test on a device or the emulator. That also stops tests from touching a real project. Our guide to shipping Flutter and Firebase apps as an indie developer shows how we structure that layer.

How do you confirm it is fixed?

Cold-start the app on each platform and run one call per Firebase product you use, with logging around initializeApp.

  1. Fully stop the app, then run it again with flutter run.
  2. Log a line before and after await Firebase.initializeApp(), and confirm nothing Firebase-related logs before the first line.
  3. Send a test push with the app in the background to prove the handler initialises.
  4. Run every entry point and flavor you ship, not just the default one.
Four boxes showing the background message handler rules: a named top-level function, the vm entry-point annotation, a call to initializeApp inside the handler, and finishing the work quickly
What a Flutter background message handler needs.

If you want to see how we apply this across our own Flutter and Firebase apps, the GSPTeck homepage lists them.

Vertical Pinterest graphic with five fixes for the Flutter error No Firebase App DEFAULT has been created
Pinterest pin: fix No Firebase App DEFAULT in Flutter.

FAQ

Do I need to call Firebase.initializeApp() on every screen?

No. Call it once at startup, awaited, before runApp(). Calling it again per screen adds nothing and can hide the real ordering problem.

Why does my app work in debug but show no-app in the release build?

Usually a handler or entry point that release mode strips or never runs. Check that background handlers are top-level and annotated with @pragma('vm:entry-point'). Our debug-versus-release guide lists other differences.

Does the no-app error mean my firebase_options.dart is wrong?

Not by itself. It only means no app was created when Firebase was used. A wrong or stale options file usually causes a different error, such as an unsupported platform, or fails on a single platform.

Is firebase_options.dart a secret?

Firebase's setup guide describes it as containing unique but non-secret identifiers for each platform. Protect your data with Security Rules and App Check rather than by hiding that file.

Sources