I'm working in swift on Xcode and by default it creates a test file that references XCTest.
When I set the target membership to my main project it causes this error
Cannot load underlying module for XCTest
If this target membership is not set the tests runs properly and everything works fine.
PS: I'm new to swift and it's probably a dumb question (please enlighten me)
Double check that the file in question is not in the main target but instead only the test target. Only the test target will have that framework to import.