Can no longer import app module into unit tests after changing deployment target
This worked just fine until I changed my deployment target from 7.0 to 8.4.
Now building and running my app still works perfectly, but running unit tests stopped working. The compiler complains about the above import statement:
Swift Compiler Error: Module file's minimum deployment target is iOS8.4 v8.4
I have no clue why. Did I forget to change the deployment target somewhere else?
My workspace (Xcode 6.4.) contains my own project and a Pods project (automatically created by cocoapods). I’m using both Swift and Objective-C in my app and in my tests.
Here’s what I did in more detail:
1) Changed deployment target from 7.0 to 8.4 for my project, my main target, and also for the
Pods project in my workspace, and all the pods targets.
2) Cleaned the build folder (Shift+Alt+Cmd+K) and restarted Xcode.
3) Cmd+U -> Error
When changing the main app’s deployment target back to 7.0, everything works fine again.
Any ideas where this problem is coming from?
- How to differentiate multiple targets with Xcode 4.2
- “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift."
- iPhone apps with a deployment target lower than 4.3 should include an armv6 architecture
- Xcode build setting “Build Products Path” (CONFIGURATION_BUILD_DIR) is a lie?
- How do I configure full URLs in xcconfig files
- Accessing Deployment Target in unit test code
Solutions Collect From Internet About “Can no longer import app module into unit tests after changing deployment target”
You were almost there, you just need to update the iOS Deployment Target for your Project and both of your targets.
For your project:
For your app target:
For your test target:
You should probably do a clean and rebuild, no need to restart Xcode. I guess this will also work if you want to target 8.1 etc.
- What types of dates are these?
- SyntaxError: Unexpected token M (when running cordova project from Visual Studio 2015)
- How to use subscript and superscript in Swift
- Duplicate protocol definition warning, but I need multiples of this protocol
- XCode Cant' Edit CoreData Model
- Implementing UITextFieldDelegate with Swift
- For Soap NSURLConnection, Please ensure that your app supports IPv6 networks, as IPv6 compatibility is required
- Order two NSMutableArrays based on one
- Difference between two NSDate objects — Result also a NSDate
- Can not compress dSyms
- GPUImage swift iOS 7
- Display all contacts from the iOS device in custom table viewcontoller when contacts button is clicked rather than default view of the device
- New iOS App struggling with Facebook Graph api v2.0
- iOS NSMethodSignature (or encoding) of NSBlock
- Set view controllers property before pushViewController