ios – Flutter – No Firebase App ‘[DEFAULT]’ has been created after WatchOS companion app added


I’ve a Flutter app which makes use of a number of Firebase companies. It labored high-quality till I added an Apple Watch extension. Since then it throws No Firebase App '[DEFAULT]' has been created - name Firebase.initializeApp().

I’ve three completely different construct configs so I take advantage of a script to repeat the right Google-Service-Data.plist file. The script is added through Xcode -> MyTarget -> Construct Phases -> Run Script.
The file is copied correctly in buildtime. If I change department (with no Watch app) it really works high-quality. So I am fairly certain the Watch app prompted the difficulty.

I positively name Firebase.initializeApp() at the start of the major operate of the Flutter app like this:

void major() async {
 WidgetsFlutterBinding.ensureInitialized();
 await Firebase.initializeApp();
 // ... different stuff ...
}

Anybody else confronted this difficulty? What am I lacking?

Leave a Reply