【问题标题】:Can't build my Swift application using my own framework after xcode's 12.5 updatexcode 12.5 更新后无法使用我自己的框架构建我的 Swift 应用程序
【发布时间】:2021-08-16 11:13:59
【问题描述】:

自从 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),但是当我尝试导入或嵌入到我的应用程序中时,我遇到了与 equatable 的一致性相同的错误,还有这个新错误:

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

【问题讨论】:

  • 您的最低部署目标是否高于受支持的版本?收(IPHONEOS_DEPLOYMENT_TARGET)
  • 其实是一样的,我在应用测试中的Deployment Info值中指定10.2,在我的框架中iOSDeploymentTarget中指定10.2
  • 我想我终于用 swift 5.4 重建了我的 xcframework。但是当我尝试将它添加到我的应用程序中时,我得到了一些不同的错误: Failed to build module '' from its module interface;它可能已损坏或在生成时触发了 Swift 编译器中的错误
  • 我终于编辑了可达性库,删除了 Reachability.NetworkStatus 函数。在此之后,我可以使用新的 xcode 版本再次构建我的框架,当我在我的应用程序中导入我的框架时我没有更多错误

标签: ios swift reachability xcode12 reachability-swift


【解决方案1】:

我通过将 Equatable 一致性添加到 NetworkStatus 来编辑 Reachability.swift。发布后,使用 xcode 版本 12.5.1 再次重建了框架。我成功地在应用程序中导入了框架并且没有错误。

【讨论】:

  • 你能告诉我们你对可达性的修改吗?
  • @gamerounet 我这样添加了 Equatable public enum NetworkStatus: CustomStringConvertible, Equatable
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多