【问题标题】:Firebase framework not found找不到 Firebase 框架
【发布时间】:2016-07-07 12:45:53
【问题描述】:

我一直在尝试将我的项目迁移到 cocoapods。

我觉得我快到了,但我陷入了困境:

ld:未找到适用于 x86_64 架构的 Firebase 框架 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

我正在尝试使用我的“app.xcworkspace”进行编译,项目如下所示:

还有:

我尝试过启动其他项目,并且 firebase 在那里工作,所以这个项目设置有问题......有什么想法吗?

我的 podfile 如下所示:

# Uncomment this line to define a global platform for your project
# platform :ios, ‘8.0’

target 'Parti' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

  # Pods for Parti

    pod 'Firebase'
    pod 'Firebase/Storage'
    pod 'Firebase/Auth'
    pod 'Firebase/Database'

  target 'PartiTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'PartiUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

当xcode尝试“链接/Users/myname/Library/Developer/Xcode/DerivedData/Parti-gsdsljzobcnqjkgutfpjasgrsfck/Build/Products/Debug-iphonesimulator/Parti.app/Parti”时可能会发生错误。

【问题讨论】:

    标签: ios swift firebase cocoapods


    【解决方案1】:

    我知道这听起来有点牵强,但是:

    1. 清理项目。产品 -> 清洁
    2. 重启XCode(并非总是需要)
    3. 从项目文件夹运行pod update & pod install

    更新:Podfile 应该更像:

        use_frameworks!
    
        target 'Parti' do
          pod 'Firebase'
          pod 'Firebase/Storage'
          pod 'Firebase/Auth'
          pod 'Firebase/Database'
        end
    
        target 'PartiUITests' do
          pod 'Firebase'
          pod 'Firebase/Storage'
          pod 'Firebase/Auth'
          pod 'Firebase/Database'
        end
    

    【讨论】:

    • 试试这个 Podfile 并重复第 3 步
    • pod update && pod install 为我工作,谢谢:)
    【解决方案2】:

    确保您在项目目标的标头搜索路径、框架搜索路径和库搜索路径中添加了 $(inherited)。

    还要确保在项目文件的 frameworks 文件夹中(不在 Pods 中,单击项目导航器中的项目名称),“libPods-YourProjectName.a”不是红色的。如果是,请将其删除并重新构建。

    【讨论】:

      【解决方案3】:

      添加 $PROJECT_DIR/Pods(使其递归)

      到框架搜索路径

      无论出于何种原因,只有这对我有帮助,也许你也是

      【讨论】:

        【解决方案4】:

        刚刚找到答案。好像我有一个旧的 geofire 版本,而新版本还不能作为 Pod...

        Github Issue link

        感谢您的回答。

        【讨论】:

          【解决方案5】:

          一些提示:

          • 确保您的 Podfile 正确(您是否忘记取消注释 use_frameworks! 行?您是否正确添加了 pod?)

          • 您忘记运行“pod install”了吗?

          • 您是否尝试过清理项目和构建文件夹?

          【讨论】:

          • 尝试了你所说的一切,但清理了构建文件夹。只是这样做了,没有运气。
          【解决方案6】:

          另一种可能是您的项目名称不是 ASCII。例如,您的名称中可能包含汉字。

          在这种情况下,在“general”->“Frameworks, Libraries, and Embedded Content”中,删除“Pods___.framework”,并在“Pods/”下添加正确名称的那个会有所帮助。

          【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-01-13
          • 1970-01-01
          • 1970-01-01
          • 2021-09-14
          • 2016-02-09
          相关资源
          最近更新 更多