由于xcode的12.5更新,我无法使用自己的框架构建应用程序。
Failed to build module 'mySwiftxcFramework' from its module interface; the compiler that produced it, 'Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)'
我的框架正在使用https://github.com/ashleymills/Reachability.swift,并且我在生成的文件上有另一个错误:x86_64-apple-ios-simulator.swiftinterface在线:
extension MySwiftFramework.Reachability.NetworkStatus : Swift.Hashable {}
我有这个错误
Conformance of 'Reachability.NetworkStatus' to 'Equatable' is unavailable
经过一些修改,我终于用Swift 5.4构建了我的库(xcframework(,但当我试图导入或嵌入到我的应用程序中时,我对equable的一致性有同样的错误,但也有这个新错误:
Failed to build module 'mySwiftxcFramework' from its module interface; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced
我通过将Equatable一致性添加到NetworkStatus来编辑Reachability.swift。之后,框架再次使用xcode 12.5.1版本进行了重建。我成功地在应用程序中导入了框架,没有任何错误。