skip to Main Content

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


  1. Chosen as BEST ANSWER

    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


  2. have you try also to close xcode and open again? sometimes happens

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search