【问题标题】:Error While Adding Dynamic Framework inside a Project在项目中添加动态框架时出错
【发布时间】:2021-09-25 20:44:09
【问题描述】:

我们创建了一个框架,它工作正常,没有任何错误,但是当我创建一个胖框架并将该框架添加到另一个项目中时,我得到了这种类型的错误

'''

显示最近的消息 未定义符号:SafexPay.SafexPay 的类型元数据访问器

未定义符号:静态 SafexPay.SafexPay.sharedInstance.getter : SafexPay.SafexPay

未定义符号:SafexPay.SafexPay.configure 的 dispatch thunk(MerchantId: Swift.String, key: Swift.String, environment: Swift.String) -> ()

未定义符号:SafexPay.SafexPay.showPaymentGateway 的 dispatch thunk(on: __C.UIViewController, price: Swift.String, orderId: Swift.String, currency: Swift.String, txnType: Swift.String, channel: Swift.String , countryCode: Swift.String, 聚合器: Swift.String, successUrl: Swift.String, failureUrl: Swift.String) -> ()

'''

谁能帮我解决这个错误

【问题讨论】:

    标签: ios swift frameworks


    【解决方案1】:

    我也有同样的问题,最后发现是Swift Library Evolution.

    我们在构建fat框架的时候,把BUILD_LIBRARY_FOR_DISTRIBUTION=YES传递给xcodebuild,但是当你把它添加到项目中时,swift写的依赖没有。

    所以,只需将 BUILD_LIBRARY_FOR_DISTRIBUTION=YES 添加到 BUILDSETTINGS 即可解决此错误。

    Cocoapods 示例:

    post_install do |installer|
      installer.pods_project.build_configurations.each do |config|
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-25
      • 1970-01-01
      • 2015-09-16
      • 2019-11-17
      • 2021-03-24
      • 1970-01-01
      • 2023-03-19
      • 2012-06-30
      相关资源
      最近更新 更多