skip to Main Content

I create an application with multiple build config, bundle id, and product name. I can run the unit test but in the unit test code, there is an error shows No such module ‘ProjectName’ like in the picture below. Still, it can run the unit test and the test is passed as well. It can’t use the auto complete, though.

I have cleaned the build folder and restart the Xcode but it’s not work.

It shows No such module 'ProjectName' but it still can run

I don’t know what’s going on. Could someone give me some workaround?

Update
I found the solution. Just change the build scheme in Use [build scheme] for command-line builds to your unit test build scheme test target at the project level on info tab. Then everything works fine.

3

Answers


  1. Chosen as BEST ANSWER

    I found the solution. Just change the build scheme in Use [build scheme] for command-line builds to your unit test build scheme test target at the project level on info tab. Then everything works fine.


  2. just try to clean and restart Xcode it will work properly

    Login or Signup to reply.
    1. Delete derived data https://programmingwithswift.com/delete-derived-data-xcode/
    2. Clean the project with cmd + k
    3. Build and re-run the unit tests with cmd + u
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search