Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()

From chapter 2, I build and run the app to get the error, and the app froze on the launch screen.
I had run sh propagate-config- files.sh in Chapter 1. The final project was like that too.

Launching lib/main.dart on iPhone 14 in debug mode... Running Xcode build... Xcode build done. 12.3s Debug service listening on ws://127.0.0.1:58102/y8Cd0V4E5QI=/ws Syncing files to device iPhone 14... [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() #0 MethodChannelFirebase.app (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:193:5) #1 Firebase.app (package:firebase_core/src/firebase.dart:53:41) #2 FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33:55) #3 new ErrorReportingService (package:monitoring/src/error_reporting_service.dart:10:58) #4 main.#errorReportingService#initializer (package:wonder_words/main.dart:27:38) #5 main.<anonymous closure> (package:wonder_words/main.dart) #6 _RootZone.runBinary (dart:async/zone.dart:1665:54) #7 runZonedGuarded.<anonymous closure> (dart:async/zone.dart:1775:18) #8 _Zone._processUncaughtError (dart:async/zone.dart:1080:14) #9 _CustomZone.handleUncaughtError (dart:async/zone.dart:1284:5) #10 Future._propagateToListeners (dart<…>

I resolved the problem by opening Runner.xcworkspace by Xcode, right-clicking Runner folder → Add files to “Runner”… → select file GoogleService-Info.plist

Dear @lkp853!

I am glad you have resolved the issue yourself. GoogleService-Info.plist file must be at the correct location. Since the book was published, Firebase introduced a new way of adding the necessary files to the Flutter application (with the help of their CLI), which might be worth checking out as it is much easier compared to what we described in the book. I’m sure that in the next edition of the book, this will be updated.
Sincerely
Vid Palčar

1 Like