为什么我会收到错误:类型'Auth'的值没有成员'useEmulator'



我遵循本教程来尝试设置Firebase模拟器套件。但是,我得到以下错误:"Auth"类型的值没有成员"useEmulator"。这是我的代码:

import UIKit
import Firebase
import IQKeyboardManager
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
// code block used for local testing where error is showing
let settings = Firestore.firestore().settings
settings.host = "localhost:8080"
settings.isPersistenceEnabled = false
settings.isSSLEnabled = false
Firestore.firestore().settings = settings
Functions.functions().useFunctionsEmulator(origin: "http://localhost:5001")
Auth.auth().useEmulator(withHost:"localhost", port:9099)
//
IQKeyboardManager.shared().isEnabled = true

return true
}
// MARK: UISceneSession Lifecycle
@available(iOS 13.0, *)
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}

}

播客文件:

# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'

target 'Pikit' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Pikit
pod 'Firebase'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Functions'
pod 'Firebase/Firestore'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'FirebaseUI', '~> 8.0'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'FirebaseUI/OAuth' # Used for Sign in with Apple, Twitter, etc
pod 'FirebaseUI/Phone'
pod 'IQKeyboardManager' # Auto move screen for keyboard
pod 'SDWebImage', :modular_headers => true
pod 'PureLayout'

end

我曾尝试构建和清理我的文件夹,但没有成功。我认为我没有把提供的代码放在合适的位置,但文档中没有指示它应该放在哪里。

这件事发生在我身上,我发现我的火球舱已经完全过时了。在我更新到最新版本后解决了(目前对我来说,Firebase/Auth是8.12(

如果它能帮助任何人。Cocoapods没有安装最新的Firebase SDK。

在您的播客文件中:
启用最小SDK:platform :ios, '14.0'
更改为pod 'FirebaseFirestoreSwift', '~> 7.0-beta'

相关内容

  • 没有找到相关文章

最新更新