Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
951 views
in Technique[技术] by (71.8m points)

swift - Cannot load underlying module for XCTest

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...