objective-c - XCode 单元测试中没有这样的模块 <product module name>

标签 objective-c xcode swift unit-testing compilation

我有一个混合的 objective-c 和 Swift 项目,我尝试为它编写单元测试。 我的项目名称是:Alphaproject 我的产品模块名称是:Alphaproject 我在我的主要目标(Alphaproject)中设置为 YES Defines Module 并设置为 YES EnableTestability for Debug only in this same Target.

在我的测试类中,我尝试导入我的产品模块名称:

@testable 导入 Alphaproject

补充说明:

  • 我所有的项目文件都只是主要目标的一部分
  • 我的测试文件只是测试目标的一部分
  • 我的测试方案设置为构建调试配置。
  • 我还尝试清理 Build 文件夹(ALT + Clean)
  • 项目在编译或尝试运行测试时没有任何错误,除了这个“没有这样的模块 Alphaproject”

还有其他想法吗?

最佳答案

好的!问题出在我的 Valid Architectures 调试配置中有 arm64。 由于主要目标在 Valid Architectures 中也不包含 arm64,因此显然找不到该模块...... 我认为苹果可以在此处显示正确的错误方面做得更好。 (苹果,如果你读我的话,请)

enter image description here

关于objective-c - XCode 单元测试中没有这样的模块 <product module name>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36075127/

相关文章:

objective-c - 使用 AFNetworking 从中获取 JSON null

ios - 如何在 UITableView 中重复使用单元格?

ios - 如何更新 iOS 中覆盖 supportedInterfaceOrientations 函数的旧 Swift 代码?

ios - 打开并编辑Swift 3.0插件SDK

ios - Facebook 使用 Firebase 和 LoginButton 登录 IOS

ios - 按下按钮时如何更改图像?

objective-c - 快速重新加载 UITableView 数据 (iOS)

ios - 在 App Store 上提交 App

ios - Xcode 7 : warning: Ambiguous Content: The launch image set "LaunchImage" has 9 unassigned children

swift - Eureka- 根据 ActionSheetRow 值隐藏行