My Flutter/Firebase app is showing no app has been configured yet

I am making an app in Flutter/Firebase and I am experiencing the following error on my visual studio code terminal:

Xcode build done. 522.2s 6.26.0 - [Firebase/Core][I-COR000005] No app has been configured yet. 6.26.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: messaging/ios/client#method_swizzling_in_firebase_messaging to ensure proper integration. Waiting for iPhone 11 to report its views... 9ms Syncing files to device iPhone 11... 610ms 
1

5 Answers

I solved the issue. If you are using swift in your AppDelegate.swift, make sure you've added the following in that order:

import Firebase FirebaseApp.configure() //add this before the code below GeneratedPluginRegistrant.register(with: self) 

If you're using flutter with objective-c, add the following to your appdelgate.m file:-

didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; //add this right after the above 
3

with adding FirebaseApp.configure(), do not forget to import Firebase.

AppDelegate.swift file should start like this:

import UIKit import Firebase 
3

Here is another method to initialize Firebase which is done by editing your main.dart.

This is probably the preferred solution, because it doesn't initialize Firebase until all of your application widgets are initialized. I had a situation where some Widgets weren't working because their reference to the Firebase instance was null.

WidgetsFlutterBinding.ensureInitialized(); is necessary to do class initialization.

Although the solution given by Sai works, I suspect it doesn't always work due to a subtle initialization issue.

void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp(MyApp()); } 
3

I also had 'No app has been configured yet' message, this is just a warning, after call await FirebaseMessaging.instance.requestPermission and accept permission(IOS need permission from user), I will get notification from FCM. Of course, on my main function, I need to add these(for new Dart initialization).

WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); 

No need add 'GoogleService-Info' and FirebaseApp.configure() in AppDelegate anymore, because FlutterFire now supports initialization directly from Dart! New Dart initialization document here:

3

In AppDelegate File

  1. import Firebase
  2. Add FirebaseApp.configure() just above the GeneratedPluginRegistrant.register(with: self).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like