I have a Flutter app which uses several Firebase services. It worked fine until I added an Apple Watch extension. Since then it throws No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
.
I have three different build configs so I use a script to copy the proper Google-Service-Info.plist
file. The script is added via Xcode -> MyTarget -> Build Phases -> Run Script.
The file is copied properly in buildtime. If I switch branch (with no Watch app) it works fine. So I'm quite sure the Watch app caused the issue.
I definitely call Firebase.initializeApp()
at the beginning of the main
function of the Flutter app like this:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
// ... other stuff ...
}
Anyone else faced this issue? What am I missing?