Reputation: 22926
I have XCode installed because flutter doctor required it but I am not using it.
I am using VSCode.
In VSCode where am I supposed to put this file called GoogleService-Info.plist
?
The project uses Flutter and Firebase.
This is the error:
Exception has occurred. FirebaseException ([core/not-initialized] Firebase has not been correctly initialized. Have you added the "GoogleService-Info.plist" file to the project?
Upvotes: 2
Views: 8298
Reputation: 2077
In VSCode, follow this steps
And configure firebase in AppDelegate.swift
file like this
import UIKit
import Flutter
import Firebase /// 1. ADD THIS LINE
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure() /// 2. ADD THIS LINE
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Upvotes: 12
Reputation: 7706
Add the GoogleService-Info.plist
file to the project by following these steps from the documentation:
- Using Xcode, open the project's ios/{projectName}.xcworkspace file. Right click Runner from the left-hand side project navigation within Xcode and select "Add files".
- Select the GoogleService-Info.plist file you downloaded, and ensure the "Copy items if needed" checkbox is enabled.
Upvotes: 4
Reputation: 364
Go to your "projectName">android>app and dump the file in this directory.
Upvotes: -4