1

I'm trying to get the FlutterFire Database working on the iOS part (it works fine on Android) of my application, but I'm getting some error messages saying that my GoogleService-Info.plist file is no where to be found. But I'm pretty sure it is placed correctly in my project.
This is the console output:

[Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure] to your application initialization. Read more: https://firebase.google.com/docs/ios/setup#initialize_firebase_in_your_app.
[Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
[Firebase/Core][I-COR000005] No app has been configured yet.
*** Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp configure] could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x000000010ccad34b __exceptionPreprocess + 171
        1   libobjc.A.dylib                     0x000000010c70e21e objc_exception_throw + 48
        2   CoreFoundation                      0x000000010cd16265 +[NSException raise:format:] + 197
        3   Runner                              0x0000000109bdeb67 +[FIRApp configure] + 353
        4   Runner                              0x0000000109b79979 -[FirebaseDatabasePlugin init] + 185
        5   Runner                              0x0000000109b79838 +[FirebaseDatabasePlugin registerWithRegistrar:] + 168
        6   Runner                              0x0000000109b765e9 +[GeneratedPluginRegistrant registerWithRegistry:] + 121
        7   Runner                              0x0000000109b76473 -[AppDelegate application:didFinishLaunchingWithOptions:] + 99
        8   UIKit                               0x000000010d0c70be -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 290
        9   UIKit                               0x000000010d0c8a43 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4236
        10  UIKit                               0x000000010d0cede9 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
        11  UIKit                               0x000000010d0cbf69 -[UIApplication workspaceDidEndTransaction:] + 188
        12  FrontBoardServices                  0x0000000110fd4723 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
        13  FrontBoardServices                  0x0000000110fd459c -[FBSSerialQueue _performNext] + 189
        14  FrontBoardServices                  0x0000000110fd4925 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
        15  CoreFoundation                      0x000000010cc52311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        16  CoreFoundation                      0x000000010cc3759c __CFRunLoopDoSources0 + 556
        17  CoreFoundation                      0x000000010cc36a86 __CFRunLoopRun + 918
        18  CoreFoundation                      0x000000010cc36494 CFRunLoopRunSpecific + 420
        19  UIKit                               0x000000010d0ca7e6 -[UIApplication _run] + 434
        20  UIKit                               0x000000010d0d0964 UIApplicationMain + 159
        21  Runner                              0x0000000109b7654f main + 111
        22  libdyld.dylib                       0x000000010ea9d68d start + 1
        23  ???                                 0x0000000000000008 0x0 + 8
    )

And here is a screenshot of my project tree: enter image description here

I'm trying this in the GeoFire plugin example folder, which can be found here: https://github.com/bramvbilsen/Flutter-GeoFire/tree/master/example I'd love to hear whether you guys have more luck and a possible solution of course!

Bram Vanbilsen
  • 5,763
  • 12
  • 51
  • 84
  • Did you call the configure function the first error message references? – Connor Neville Oct 06 '17 at 17:28
  • I did not, where should this be called? I'm just using the `FlutterFire` plugin and thought the exact Dart code that runs on Android would run on iOS. – Bram Vanbilsen Oct 06 '17 at 17:32
  • I'm not familiar with FlutterFire, but when configuring a project that just uses Firebase, it's always required me to call `FirebaseApp.configure()`. Best to put it in `AppDelegate`'s `didFinishLaunching`. – Connor Neville Oct 06 '17 at 17:36
  • I can't even import `Firebase` in my `AppDelegate.m` file! I'm lost... – Bram Vanbilsen Oct 06 '17 at 19:04
  • "could not find a valid GoogleService-Info.plist in your project" Make sure that you download the `GoogleService-Info.plist` from the Firebase console and add it to the correct spot in your project. See https://stackoverflow.com/questions/45317777/could-not-find-a-valid-googleservice-info-plist-in-your-project – Frank van Puffelen Oct 06 '17 at 19:21
  • But I'm 99% sure I did do that correctly! Like you can see my project tree has the file included on the correct place. I downloaded the file from my firebase console and the bundle id has been set correctly. – Bram Vanbilsen Oct 06 '17 at 19:31
  • Would any of you be so kind to see take a look whether you are getting the same error result with the provided repo? – Bram Vanbilsen Oct 06 '17 at 19:32

1 Answers1

3

Alright, I found the solution! Apparently Xcode 9 doesn't add the file to your actual project!

  1. This can be fixed be clicking on the GoogleServices-info.plist file
  2. Checking the Runner project in the Target Membership tab
Bram Vanbilsen
  • 5,763
  • 12
  • 51
  • 84