【问题标题】:Undefined symbols for architecture x86_64 in Xcode after Firebase updateFirebase 更新后 Xcode 中架构 x86_64 的未定义符号
【发布时间】:2017-10-26 13:16:19
【问题描述】:

自从我在 Xcode 中收到此编译器错误后,我将 FirebaseUI 更新到了最新版本,并且更新了 TwitterCore 3.0.0(原为 2.8.0):

Undefined symbols for architecture x86_64:
  "_TWTRIdentifierForAdvertising", referenced from:
      +[TWTRCardConfiguration deviceID] in TwitterKit(TWTRCardConfiguration.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我目前已恢复到以前版本的 TwitterCore,即使它没有明确写入我的 Podfile。我写了pod 'TwitterCore', '~>2.8.0'

【问题讨论】:

    标签: ios xcode firebase firebaseui


    【解决方案1】:

    我已修复 TwitterCore >3.0.0 是 FirebaseUI > 3.0.0 或更新 pod 的问题

    pod 'FirebaseUI'
    pod 'TwitterCore', '<=2.8.0' # fixed
    

    祝你好运

    【讨论】:

      【解决方案2】:

      我注意到在 quickstart-ios 附带的 Firebase DatabaseExample podfile 中,“FirebaseUI”被重命名为“FirebaseUI/Database”。 我用正确的名称将它添加到 podfile 中,一切似乎都正常。

      【讨论】:

      • 这对我也有用。仅使用 FirebaseUI/Database pod 解决了链接器错误。
      【解决方案3】:

      如果您仍然在为这个错误而苦苦挣扎,那么这里就是我的解决方案。我注意到上面的一些解决方案并没有解决 Twitter 包的问题,​​因为它们只是删除了对它的引用,这对于那些想要处理 Twitter 功能的人来说不是正确的方法。

      目前,FirebaseUI 版本是 4.1.1TwitterKit >= 2.4 满足其要求,但根据我的测试最新的 2.* 版本(现在是 2.8.1)生成未定义的错误符号引用。

      我检查了FirebaseUI 4.1.1 与早期的TwitterKit 2.7 配合得很好。所以我的解决方案是强制 te cocoapod 安装这个版本。

      按照程序进行:

      1) 将这两个实例添加到您的 Podfile。 (如果您不想全部安装 FirebaseUI 的子规范,可以选择性地添加它们)。

      pod 'TwitterKit' , '2.7' 
      
      pod 'FirebaseUI', '~> 4.0'
      

      2) 运行:

      pod update
      

      【讨论】:

        【解决方案4】:

        我已经解决了这个问题:

        # Uncomment this line to define a global platform for your project
        platform :ios, '9.0'
        # Uncomment this line if you're using Swift
        use_frameworks!
        
        target 'app name' do
        
        #pod 'FirebaseUI'
        pod 'FirebaseUI/Database'
        pod 'Firebase/Storage'
        
        post_install do |installer|
        installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '3.0'
        end
        end
        end
        end
        

        如您所见,我评论了FirebaseUI 并使用FirebaseUI/Database 用于数据库和Firebase/Storage 用于存储。

        【讨论】:

          【解决方案5】:

          这将是如何定义 podfile 版本的示例。

          示例:

          目标“你的项目”做

          pod 'Firebase', '~> 1.0'
          

          结束

          【讨论】:

          • 我知道,但有些 pod 内部包含其他依赖项和 pod。我添加了“pod 'TwitterCore', '~>2.8.0'”,尽管我一开始没有将它写在 Podfile 中
          【解决方案6】:

          就我而言,它只是被注释掉了:

          # pod 'FirebaseUI/Twitter'

          【讨论】:

            【解决方案7】:

            在 Xcode 9、Swift 3、Firebase 中

            -> _TWTRIdentifierForAdvertising",参考

            这对我有帮助:

            首先在你的 Podfile 中添加: pod 'FirebaseUI', '~> 4.0'

            之后: 豆荚更新

            【讨论】:

              【解决方案8】:

              如果您在 测试 中使用它 pod。您必须在 MyAppTests 目标中添加 pod。

              例如:

              platform :ios, '9.0'
              
              target 'MyApp' do
                use_frameworks!
              
                pod 'TwitterCore', '~>3.0.0'
              
                target 'MyAppTests' do
                  inherit! :search_paths
              
                  pod 'TwitterCore', '~>3.0.0'
              
                end
              
              end
              

              【讨论】:

                猜你喜欢
                • 1970-01-01
                • 1970-01-01
                • 2017-07-06
                • 1970-01-01
                • 2021-03-12
                • 2016-11-07
                • 2015-11-24
                • 2013-03-09
                • 2013-02-07
                相关资源
                最近更新 更多