The error cannot find auto-link library XCTest and XCTestSwiftSupport?

This morning I updated my mac and then updated Xcode to 11.4.
And then I opened my project (changed nothing, but built successfully yesterday).
It shows the error "Could not find or use auto-linked library 'XCTestSwiftSupport' ld: warning: Could not find or use auto-linked framework 'XCTest'"
Do you meet the weird issue?
I found the linkerror to link static libraries

2 Likes

I have faced with the same issue none of found solutions are working.

I have the exact same issue, and I haven't found any solution so far.
I have a full swift project which is building nicely with Xcode 11.3.1

1 Like

In my case settings ENABLE_TESTING_SEARCH_PATHS to YES fixed the issue.

13 Likes

Thanks @georgescumihai; that worked! I experienced this issue after I added a custom extension to Apple's XCTestCase class in a library that I created. How did you discover this solution? Is there a reference article somewhere with more details on all of these build settings?

1 Like

that works for me too. thx

Don't remember exactly, most likely stackoverflow.

The actual solution is to exclude test sources from main targets build. For Xcode 12.04 select target / Build Phases / Compile Sources and remove the test classes.

The test classes should be only in the test Target

3 Likes

Yey! It's done! Thanks :)

Terms of Service

Privacy Policy

Cookie Policy