I am using XCTest for unit testing in my iOS project in Xcode. When I try to build my project, I receive this error message:
No such module ‘XCTest’
I have already verified that XCTest.framework
is included in the "Link Binary With Libraries" section of my target’s build phases.
I have tried the following troubleshooting steps without success:
- Cleaning the build folder and rebuilding the project.
- Verifying that XCTest is correctly imported in my test files (
import XCTest
). - Ensuring that my project’s target includes XCTest as a dependency.
Despite these efforts, I am still encountering the error.
Can someone please provide guidance on how to resolve this issue?
2
Answers
i solved it with this incase anyone comes across the same issue am on xcode 15.2 earltedly.github.io/posts/no-such-module-xctest enable this SYSTEM_FRAMEWORK_SEARCH_PATHS=YES in your target Build settings
have you try also to close xcode and open again? sometimes happens