您是否已将“GoogleService-Info.plist”文件添加到项目中?--- Firebase 与 Flutter 和 Visual Studio 代码

Aqu*_*irl 2 firebase visual-studio-code flutter

我安装了 XCode,因为 flutter doctor 需要它,但我没有使用它。

我正在使用 VSCode。
在 VSCode 中我应该把这个名为 的文件放在哪里GoogleService-Info.plist

该项目使用 Flutter 和 Firebase。

这是错误:

Exception has occurred. FirebaseException ([core/not-initialized] Firebase has not been correctly initialized. Have you added the "GoogleService-Info.plist" file to the project?

Hem*_*iya 8

在 VSCode 中,按照以下步骤操作

\n
    \n
  1. 右键单击ios文件夹
  2. \n
  3. 选择在 Xcode 中打开
  4. \n
  5. 选择“跑步者”>“跑步者”并右键单击
  6. \n
  7. 选择将文件添加到\xe2\x80\x98Runner\xe2\x80\x99
  8. \n
  9. 选择您的GoogleService-Info.plist并按添加
  10. \n
\n

AppDelegate.swift并在这样的文件中配置 firebase

\n
import UIKit\nimport Flutter\nimport Firebase  /// 1. ADD THIS LINE\n\n@UIApplicationMain\n@objc class AppDelegate: FlutterAppDelegate {\n  override func application(\n    _ application: UIApplication,\n    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?\n  ) -> Bool {\n    FirebaseApp.configure() /// 2. ADD THIS LINE\n    GeneratedPluginRegistrant.register(with: self)\n \n    return super.application(application, didFinishLaunchingWithOptions: launchOptions)\n  }\n}\n
Run Code Online (Sandbox Code Playgroud)\n