您将如何修复Xcode Firebase与SwiftUI的集成 说: 格式:@ "`[FIRApp configure];` (`FirebaseApp.configure()` in Swift)



我不知道我需要什么来解决这个问题。

我在Xcode的工作区中运行了Firebase,我遵循了Firebase的说明,这些说明是:

import UIKit
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
}

但问题是,当我运行该项目时,模拟是白色的。然后转到FirApp.m并说出以下代码。

if (!options) {
[NSException raise:kFirebaseCoreErrorDomain
format:@"`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find "
@"a valid GoogleService-Info.plist in your project. Please download one "
@"from %@.",
kPlistURL];

我一直在用这个教程跟随CodingWithChris-->https://youtu.be/1HN7usMROt8?t=2363

再次下载时,必须确保GoogleService-Info.plist的外观与GoogleServiceInfo.plist(5(不同,否则它将无法工作。

为了处理黑屏,错误如下:

Failed to instantiate the default view controller for UIMainStoryboardFile 'MainStoryboard' - perhaps the designated entry point is not set?

在情节提要中,请确保取消选中";是初始视图控制器";因为它可能会与多个视图控制器混淆。在应用程序中,转到应用程序目标并按下"信息"选项卡;主情节提要文件的基本名称";你需要用减号来使它消失。然后在";"常规"选项卡;clear对";主界面";。

最新更新