Xcode Unit Test build error “Unexpected '@' in program”

こ雲淡風輕ζ 提交于 2019-12-11 21:28:16

问题


Trying to build a unit test (XCTest) and get the following error in several files:

@import Foundation; =======> Unexpected '@' in program

@import UIKit; =======> Unexpected '@' in program

(etc.)

I do not get this compile error for the regular build, only unit tests. What seem really odd to me is that the source files that are generating the errors are not even part of the unit test Compile Sources in Build Phases! (not needed for unit testing)

What is the conflict?


回答1:


Please check if you enabled "Enable Modules" in your test target build settings.



来源:https://stackoverflow.com/questions/24256709/xcode-unit-test-build-error-unexpected-in-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!