由于某些 Swift 版本炎问题,无法构建模块 XCTest?

sai*_*eak 9 xcode ios swift

我认为这发生在最近的 XCode 更新期间。我试过清理和重建,但无济于事......

Failed to build module 'XCTest' from its module interface; 
the compiler that produced it, 
'Apple Swift version 5.3 (swiftlang-1200.2.26.4 clang-1200.0.29.4)',
may have used features that aren't supported by this compiler, 
'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)'
Run Code Online (Sandbox Code Playgroud)

Max*_*ral 9

点击文件,打开右侧的检查器,并确保该文件包含在测试目标中。


小智 -2

我假设您使用的是 xcode 12。您应该尝试使用 xcode 11。并确保使用 ios 目标版本 9.0 进行测试。这对我有用。