【问题标题】:Old framework version incompatible with iOS 13, new framework incompatible with iOS 12老框架版本不兼容iOS 13,新框架不兼容iOS 12
【发布时间】:2020-01-19 05:54:40
【问题描述】:

我开发了一个使用 Moya 和 Alamofire 框架的 swift iOS 应用程序。

在准备 iOS 13 时,我下载了带有 Swift 5.1 的 Xcode 11,当我加载我的项目时,Moya 框架报告错误“使用 Swift 5.0 编译的模块无法通过 Swift 5.1 编译器导入”。

我尝试使用此解决方案 Module compiled with Swift 4.0 cannot be imported in Swift 4.0.1 进行故障排除,但是没有帮助,因此我安装了框架的预发布版本。

但是,该应用现在无法在 iOS 12 上运行,因为 Moya 的预发布版本(可能是 Moya 所依赖的 Alamofire)使用了 Apple 的 Combine 框架。

是否有任何其他解决方案,或者我必须让这个应用程序仅在 iOS 13 上运行才能满足自己?

【问题讨论】:

  • 尝试将这些模块文件作为第三方直接添加到项目中,而不是 Pod。请记住删除 import Alamofire 之类的导入。

标签: ios swift frameworks backwards-compatibility


【解决方案1】:

使用“清理”+“删除派生数据”;在首选项中选择适当的“命令行工具”。再次重建

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-30
    • 2014-07-26
    • 2021-10-01
    • 1970-01-01
    • 2019-08-04
    • 1970-01-01
    • 1970-01-01
    • 2011-04-01
    相关资源
    最近更新 更多