49

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:
https://firebase.google.com/docs/cloud- 
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
Francesco - FL
  • 603
  • 1
  • 4
  • 25
Sai Prashanth
  • 1,621
  • 2
  • 6
  • 21

5 Answers5

103

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
SwiftiSwift
  • 7,528
  • 9
  • 56
  • 96
Sai Prashanth
  • 1,621
  • 2
  • 6
  • 21
  • 3
    OK. Here's a super funny (aka odd) thing. I have two projects that connect to the same FireBase. One wouldn't build, I used this solution AND IT WORKED. The other one doesn't have the FirebaseApp.configure(), but it works too. I'm sure there is an alternate way to do this, and I'll report back when I figure it out. – Curt Eckhart Nov 22 '20 at 01:55
  • 1
    Same thing started to happen here after update flutter to 2.0.1. This worked for me as well. But still doesn't understand why I had to update the AppDelegate.swift file. Feels the same @CurtEckhart, have you found why? – Rodolfo Gonçalves Mar 08 '21 at 21:20
  • 3
    (for swift)As mentioned below you have to import firebase at the top `import Firebase` – Luis May 17 '21 at 18:54
27

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

AppDelegate.swift file should start like this:

import UIKit
import Firebase
eldar
  • 272
  • 4
  • 8
8

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());
}
Curt Eckhart
  • 455
  • 5
  • 11
7

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: https://firebase.flutter.dev/docs/overview/

Hien.Nguyen
  • 282
  • 5
  • 3
  • 1
    Can you explain this further? The answer is not very concise. I'm using the new Dart initialization, although I'm receiving the missing GoogleServices log as well. – Bret Hagen Dec 31 '21 at 01:13
  • @BretHagen, I edited my answer a little bit. I mean if you following new Dart initialization from document, you can get notification even though you get this message 'No app has been configured yet', may be this message at this time just a warning. FlutterFire document here: https://firebase.flutter.dev/docs/overview/ – Hien.Nguyen Dec 31 '21 at 06:31
  • 2
    you are right, the warning just showing for no affection. With the FlutterFire latest version, we don't need to manually configure anymore. – apieceofcode1801 Feb 09 '22 at 09:51
3

In AppDelegate File

  1. import Firebase
  2. Add FirebaseApp.configure() just above the GeneratedPluginRegistrant.register(with: self).
ARMUGHAN ALI
  • 339
  • 3
  • 5