ios - 如何让 AWS 框架在 Xcode 11 中工作?
问题描述
我试图通过手动导入 AWS 框架在 Xcode(版本 11.2.1)中工作。我让它们工作的唯一方法是将它们添加到构建阶段下的嵌入框架中。一切都很好,直到我将 AWSMobileClient 导入我的一个 swift 文件中。这里出了问题。如果我尝试在设备模拟器上构建项目,我会收到此错误:
Could not find module 'AWSMobileClient' for target 'x86_64-apple-ios-simulator'; found: arm64, armv7-apple-ios, arm64-apple-ios, arm, armv7
然后我切换到物理设备,我得到这个错误:
Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler: /Users/lukacefarin/Library/Mobile Documents/com~apple~CloudDocs/Projects/InoSupport/AWSMobileClient.framework/Modules/AWSMobileClient.swiftmodule/arm64-apple-ios.swiftmodule
我在堆栈溢出时读到了这个错误,除了等待 AWS 修复它之外,我似乎无能为力。
有什么解决方法吗?我所有的项目框架都是手动导入的,所以我不想使用 Cocoapods 或 Carthage。
2020 年 2 月 9 日编辑:
我在 GitHub 上发布了这个问题,并得到了他们正在研究解决方案的重播。我猜到那时使用依赖管理器。
解决方案
正如你所见,我遇到了同样的问题,我的本地 swift 版本是 5.1.3。
"Incompatible Swift version - framework was built with 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7) and the local version is 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)."
所以,我不得不寻找与我安装的 swift 版本 5.1.3 兼容的 aws-sdk-ios 版本。
您安装的 swift 版本是 5.1.2。在我的尝试中,我发现了一个与您本地版本的 swift 5.1.2 兼容的 aws-sdk-ios 版本。
尝试使用 aws-sdk-ios "2.13.0",我的日志说这个框架是用 5.1.2 构建的。
*** Checking out aws-sdk-ios at "2.13.0"
*** Downloading aws-sdk-ios.framework binary at "AWS SDK for iOS 2.13.0"
*** Skipped installing aws-sdk-ios.framework binary due to the error:
"Incompatible Swift version - framework was built with 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9) and the local version is 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)."
推荐阅读
- node.js - 使用 webpack 捆绑库以在浏览器中使用的问题
- security - 如何在我自己的身份验证服务器上使用 OAuth2?
- android - 如何使用确定按钮显示下载完成弹出窗口
- java - 返回当前的 android 布局或屏幕宽度以进行调试
- android - Android:在firebase中将用户注册为管理员
- c++ - Windows Server 2016 上 EnableStatic 的不同行为
- vba - 从工作表 vba 中修剪最后 4 个字符
- javascript - Syncfusion 无法从数据源呈现 Grid 行模板表达式值
- python - Wide_deep 分类器模型,需要预测概率值,而不只是“最佳猜测”
- angular - Navigation ID is not equal to the current router navigation id 错误