Xcode 11 - Firebase问题(无法找到“Firebase”模块)

3
我尝试了这个网站上的所有可能答案,但都没有起作用。我已经添加了一个pod文件,但在导入Firebase后,我一直收到“(没有这样的模块'Firebase')”错误。
这是我的appDelegate代码:
//
//  AppDelegate.swift
//  Firebase app
//
//  Created by Karan Singh on 11/21/19.
//  Copyright © 2019 Karan Singh. All rights reserved.
//

import UIKit
import Firebase


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FirebaseApp.configure()
        return true
    }

    // MARK: UISceneSession Lifecycle

    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)
    }

    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.
    }


}

这是我的Pod文件的内容:

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

target 'Firebase app' do
  # Comment the next line if you don't want to use dynamic frameworks
 use_frameworks!

  # Pods for Firebase app

# add the Firebase pod for Google Analytics
    pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods

    pod 'Firebase/Auth'

end

我仍在学习Xcode编码 - 谢谢你帮助我!


尝试构建项目... - undefined
添加 pod 'Firebase/Core' - undefined
1
Firebase/Core已被弃用且不再必要。 - undefined
可能需要执行一次构建来预热Xcode模块缓存。 - undefined
1个回答

3
如Hurobaki所评论的,您需要在podfile中添加firebase/core,如下所示:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'FirebaseApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
    # Add the Firebase pod for Google Analytics
    pod 'Firebase/Analytics'
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
    pod 'Firebase/Auth'

end   

FirebaseOSX已经过时了。请参考https://github.com/firebase/firebase-ios-sdk#macos-and-tvos,了解当前推荐的OSX方法。 - undefined
1
Firebase/Core现已弃用。现在只需要使用Firebase/Analytics来获取核心功能,因为分析是核心功能。 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接