【问题标题】:Cocoapods Mach-O Linker Errors after adding local dynamic framework添加本地动态框架后的 Cocoapods Mach-O Linker Errors
【发布时间】:2017-04-21 20:45:24
【问题描述】:

我最近通过单击项目屏幕上的 + 按钮将我的数据模型对象移动到它们自己的框架中。我移动了所有文件并将它们的目标成员更改为AppCore,而不是App。该项目完全使用 Swift。

我将我的 podfile 更新为以下内容:

platform :ios, '10.0'
inhibit_all_warnings!

target 'App' do
    use_frameworks!
    pod 'Firebase/Core'
    pod 'Firebase/Auth'
    pod 'Firebase/Database'
    pod 'Firebase/Crash'
    pod 'Firebase/Storage'
    pod 'FBSDKCoreKit'
    pod 'FBSDKLoginKit'
    pod 'FBSDKShareKit'

    target 'AppCore' do
        inherit! :search_paths
    end
end

每当我尝试构建时,我都会遇到 4 个错误:

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_FIRDataSnapshot", referenced from: objc-class-ref in SSWorkout.o "_OBJC_CLASS_$_FIRDatabase", referenced from: objc-class-ref in SSReference.o objc-class-ref in SSReferrable.o "_OBJC_CLASS_$_FIRAuth", referenced from: objc-class-ref in SSUser.o "_OBJC_CLASS_$_FIRDatabaseReference", referenced from: objc-class-ref in SSOperation.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已经解压并重新安装了 pod,清理了项目,清理了构建文件夹,删除了派生数据等,我无法编译它。

您可以在演示项目中重现此内容,运行 pod install 并尝试构建。

https://github.com/Raesu/Demo-Proj

【问题讨论】:

    标签: ios swift firebase cocoapods


    【解决方案1】:

    Firebase pod 中的库当前构建为静态库。无法将静态库链接到动态库框架 - DemoCore 在您的示例中。

    【讨论】:

    【解决方案2】:

    尝试在 Xcode 构建设置中启用位码并进行干净的构建,这有助于我解决问题

    Xcode > Build settings> Enable bitcode
    

    【讨论】:

      猜你喜欢
      • 2014-12-03
      • 2012-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多