【问题标题】:Third party ObjC Framework dependent by the dynamic Cocoa frameworks inside a Swift App第三方 ObjC 框架依赖于 Swift 应用程序中的动态 Cocoa 框架
【发布时间】:2014-07-17 07:42:25
【问题描述】:

我需要在基于 Swift 的应用程序中使用 Ubertesters 框架。 Ubertester 框架也依赖于少数 Cocoa 框架。通常在 ObjC 环境中,您必须将一些框架添加到链接二进制文件中,但在 Swift 中不再需要。然而,当我在 Swift 中使用 Ubertester SDK 时,Ubertester SDK 所需的 Cocoa 框架依赖项似乎不是动态加载的。

这是我所做的:

  1. 我将 Ubertester 框架添加到工作区
  2. 我创建了 umbrela 标头并#import UbertesterSDK(我可以很好地看到将 Ubertester 类转换为 Swift 代码)。
  3. 我没有将 Ubertester 要求的 Cocoa 依赖框架添加到链接二进制文件中。

尝试在设备或模拟器上运行失败:

    ld: warning: relocatable dylibs (e.g. embedded frameworks) 

     are only supported on iOS 8.0 and later (@rpath/libswift_stdlib_core.dylib)

     Undefined symbols for architecture i386:

  "_AudioServicesPlaySystemSound", referenced from:

      -[Ubertesters playSystemSound:] in UbertestersSDK

  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:

      objc-class-ref in UbertestersSDK ...

知道如何调试这个错误吗?

谢谢

【问题讨论】:

    标签: ios objective-c swift


    【解决方案1】:

    看起来您在模拟器上运行的版本早于 iOS 8,并且您的库不支持架构和操作系统的组合。

    尝试将项目目标上的部署目标更改为 iOS 8 并查看是否启动。同时,我会检查您是否拥有最新版本的 SDK。

    【讨论】:

      猜你喜欢
      • 2015-05-21
      • 2018-12-01
      • 2015-08-26
      • 2017-10-26
      • 2016-04-07
      • 1970-01-01
      • 2014-04-23
      • 1970-01-01
      • 2016-02-12
      相关资源
      最近更新 更多