针对iOS 10的迦太基依赖项目无法构建,但是当针对iOS 11成功时

时间:2017-10-16 04:25:38

标签: ios swift carthage portsip

我有一个基于Swift的Cocoa Framework库,它使用module.modulemap来支持基于C的库(PortSIPLib)。该项目在Xcode中构建良好。

我通过使用以iOS 10为目标的Carthage在另一个项目中使用该框架。

当Carthage构建框架(carthage update --platform ios)时,它失败并带有

ld: warning: ignoring file /Users/.../Carthage/Checkouts/wesipkit/PortSIPLib/PortSIPLib.framework/PortSIPLib, missing required architecture i386 in file /Users/.../Carthage/Checkouts/wesipkit/PortSIPLib/PortSIPLib.framework/PortSIPLib (3 slices)
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_PortSIPSDK", referenced from:
      objc-class-ref in SIPServiceProvider.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

但如果我同时将项目和框架都用于iOS 11,那么Carthage会成功构建吗?

我尝试过使用调试和发布配置设置,都失败了

我可以采取不同的方法吗?我应该配置其他设置吗?

无论如何,我可以告诉Carthage / Xcode忽略尝试为模拟器构建吗?我不需要在模拟器中运行它

问题不在于(PortSIPLib)缺少i386实施,问题是为什么在定位iOS 11而不是iOS 10时它会起作用?

我真的花了一个星期的时间来尝试诊断这个问题,直到重新创建框架项目,直到现在才意识到问题出在iOS目标级别

Xcode版本9.1 beta(9B46)

PortSIPLib的框架module.modulemap

module PortSIPLib {
    umbrella header "PortSIPLib.framework/Headers/PortSIPSDK.h"
    header "PortSIPLib.framework/Headers/PortSIPErrors.hxx"
    header "PortSIPLib.framework/Headers/PortSIPEventDelegate.h"
    header "PortSIPLib.framework/Headers/PortSIPTypes.hxx"
    header "PortSIPLib.framework/Headers/PortSIPVideoRenderView.h"

    export *
    module * { export * }
}

这与PortSIPLib框架

一起存储在$(SRCROOT)/PortSIPLib

0 个答案:

没有答案