I am testing my App today, and everything was working well, I was testing it on iOS 15, and after that I wanted to test it on iOS 13, so I set my iOS Deployment Target to iOS 13.0, then I changed the test target to the same version: iOS 13.0, and when I try to compile my code in testing environment, the Xcode tells me Command MergeSwiftModule failed with a nonzero exit code, Compiling for iOS 13.0, but module ‘xxxTests’ has a minimum deployment target of iOS 14.2:
I am pretty sure I have set both App target and tests target to iOS 13, now the warning still persists even when I reset them to the previous settings.
I didn’t find anywhere that I have set the tests target to iOS14.2, which is so weird, did I miss anything?
4
Answers
Solved, incase anyone meets the same problem, just create a new test scheme, which will solve the problem
You can solve this deleting
$HOME/Library/Developer/Xcode/DerivedData/NAME_OF_THE_PROJECT_FOLLOWED_BY_RANDOM_STRINGS
And then building it again
I solved this problem by cleaning the build folder to do this go to the menu bar and select the following:
Product > Clean Build Folder
Alternatively there is also a shortcut to do this:
⇧+⌘+K
That’s it!