【问题标题】:Cannot import Firebase via cocoapod in swift project无法在 swift 项目中通过 cocoapod 导入 Firebase
【发布时间】:2018-03-25 07:45:22
【问题描述】:

我正在尝试将 Firebase Google SignIn 集成到我的 swift 项目中,但是当我通过 cocoapods 安装 SDK 时,import Firebase 出现错误“没有这样的模块”。我已经尝试过类似问题中提供的解决方案,但没有一个对我有帮助。我在下面提到了我的 podfile。

platform :ios, '9.0'

target 'swiftapp' do
use_frameworks!

pod 'Alamofire', '~> 4.5'
pod "Bottomsheet"
pod "SearchTextField"
pod 'Firebase'
pod 'FirebaseAuth'
pod 'FirebaseDatabase'
pod 'GoogleSignIn'

end

我还附上了一张图片,显示了我的项目中可用的所有Firebase 模块。

编辑:- 在我的项目中安装 Firebase 之前,我已经更新了我的 cocoapods。而且,出于测试目的,我尝试在一个新项目中安装 Firebase,它在该项目中运行良好。

编辑:- 我使用的是 1.3.1 版本的 cocoapods。

谁能帮忙。

谢谢

【问题讨论】:

  • 尝试删除 DerivedData
  • @PaulBeusterien 试过了,但没用。

标签: ios xcode firebase swift3


【解决方案1】:

您可以在代码中导入您需要的 Firebase 部分。例如:- 如果您需要进行 firebase 身份验证,则可以单独导入 FirebaseAuth。因此,这取决于您在 Firebase 的哪个部分工作。

【讨论】:

    【解决方案2】:

    这是一个已知问题,将 cocoapods 更新到 1.3.0 即可解决。

    你也应该有

    pod 'Firebase/Core'

    在你的 podfile 中,而不是

    pod 'Firebase'

    【讨论】:

    • 我在安装 Firebase 之前更新了 cocoapods。通过 cocoapods 安装 Firebase 在新项目中完美运行,但在我现有的项目中,我仍然面临同样的问题。
    • 我正在使用 cocoapods 1.3.1。
    • 我不是在谈论 cocoapods
    猜你喜欢
    • 1970-01-01
    • 2016-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-31
    • 2015-10-08
    • 1970-01-01
    • 2020-02-20
    相关资源
    最近更新 更多