I am facing issue while running unit tests, Issue is at line below line of code
@testable import PROJECT_NAME
Error:
Compiling for iOS 12.1, but module 'PROJECT_NAME' has a minimum deployment target of iOS 13.0: /Users/NAME/Library/Developer/Xcode/DerivedData/ftahdagcflmajidmksgextinoqip/Build/Products/Debug-iphonesimulator/PROJECT_NAME.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
I have tried following
iOS 13.0
iOS 13.0+
(current simulator is on iOS 13.5
)but no luck.
To change your deployment target, open up your project file in Xcode and check the setting under Build Settings -> Deployment(...) Check this answer to add earlier devices support.
If you haven't already, change the deployment target to the lowest iOS version you want to support, select the project name then select your app target, choose General and change the version in Deployment Info.
A deployment target is nothing more than the minimum version of the operating system the application can run on. Fire up Xcode and create a new project by choosing the App template from the iOS > Application section.
To add a unit test target to an existing Xcode project, choose File > New > Target. Select your app platform (iOS, macOS, watchOS, tvOS) from the top of the New Target Assistant. Select the Unit Testing Bundle target from the list of targets.
You say you made sure the deployment target but did you make sure the deployment target of both the app target and the unit test target? I think the error says that the deployment target of your unit test target is iOS 12.1 but your app target is 13.0.
Check this value of your unit test target:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With