Fix Firebase initialization error - no-app exception

- Add Firebase.initializeApp() call in mainCommon.dart before any Firebase-dependent code
- Make mainCommon() async to support await Firebase.initializeApp()
- Update mainDev.dart to properly await mainCommon() call
- Add android:enableOnBackInvokedCallback='true' to AndroidManifest.xml to fix OnBackInvokedCallback warning

This resolves the 'No Firebase App [DEFAULT] has been created' error that was occurring when firebase_messaging tried to access FirebaseMessaging.instance in homePage.dart. Firebase must be initialized before any Firebase APIs are used.
This commit is contained in:
vjrj 2026-03-05 19:08:33 +01:00
parent 13c6ff90f5
commit fa8c388f07
2 changed files with 7 additions and 2 deletions

View file

@ -24,5 +24,5 @@ void main() async {
logRedux == LogLevel.actions ? [] : [createLoggingMiddleware()];
// In development, Sentry is disabled, so we skip initialization
mainCommon(devMiddlewares);
await mainCommon(devMiddlewares);
}