【问题标题】:Cannot install FirebaseAuth using Carthage among with already installed firebase components无法在已安装的 Firebase 组件中使用 Carthage 安装 FirebaseAuth
【发布时间】:2019-12-26 05:58:41
【问题描述】:

在我们的项目中使用 carthage (firebase/firebase-ios-sdk) 安装了许多 Firebase 组件,这些组件成功运行。

我们尝试在已安装的 Firebase 组件之外添加 FirebaseAuth

Carthage 更新命令完成且没有错误。我们做了通常的迦太基库安装步骤。我们在构建阶段向输入文件和输出文件添加了行,然后将 FirebaseAuth.framework 添加到链接框架和库。

当我们尝试构建项目时,它构建失败。

我们试过了

  • 清理构建文件夹
  • 删除派生数据

还有其他几个小尝试。

我们已经检查过了

程序(firebase/firebase-ios-sdk) - 在项目目标上添加了 GoogleService-Info.plist - 在“构建设置”中的“其他链接器标志”中添加了 $(OTHER_LDFLAGS) -ObjC 标志。 - 从 Link Binary With Libraries Build Phase 中删除 Firebase.framework。

购物车文件

只有 firebase 部分,我们还安装了其他几个库。

binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 6.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json" == 6.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMessagingBinary.json" == 6.4.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 6.4.0

错误日志

ld: warning: Could not find auto-linked framework 'Firebase'
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GTMSessionFetcherService", referenced from:
      objc-class-ref in FirebaseAuth(FIRAuthBackend.o)
  "_GTMFetcherStandardUserAgentString", referenced from:
      +[FIRAuthBackend authUserAgent] in FirebaseAuth(FIRAuthBackend.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Showing Recent Messages
:-1: Could not find auto-linked framework 'Firebase'

:-1: Undefined symbol: _OBJC_CLASS_$_GTMSessionFetcherService

:-1: Undefined symbol: _GTMFetcherStandardUserAgentString

我们需要安装 FirebaseAuth。

我什至不确定这是否是由于尝试使用 Carthage 安装 FirebaseAuth 导致的问题。如果不可能,我们可能会使用 Cocoapods,但我们更喜欢使用 Carthage 安装 FirebaseAuth。

【问题讨论】:

    标签: ios firebase firebase-authentication carthage


    【解决方案1】:

    问题是我们没有将 Carthage 为 FirebaseAuth 创建的所有 .framework 文件添加到链接框架和库。

    添加 FirebaseAuth.framework 还不够,但我们需要添加大量其他 .framework 文件,例如以“Firebase...”、“Google...”和“gPRC...”开头的文件。

    【讨论】:

    • 我试图批准自己的答案,但被stackoverflow系统拒绝,看来我需要等待两天才能接受我的答案...
    猜你喜欢
    • 2020-12-22
    • 2013-06-06
    • 1970-01-01
    • 1970-01-01
    • 2020-09-02
    • 2017-09-20
    • 1970-01-01
    • 2021-01-30
    • 1970-01-01
    相关资源
    最近更新 更多