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 manage production and development credentials using Facebook iOS SDK
- Why does Xcode stop giving text prediction?
- Keep losing php session cookie in UIWebView
- iPhone button with non-rectangle shape?
- iOS :Call a method in specific time
- How can I open a Twitter tweet using the native Twitter app on iOS?
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.
- NSBitmapImageRep for iPhone (Or direct pixel access for CGImage)?
- “Send call” to iPhone from iPad
- View tableview cell text on table view cell button
- UIButton – On touch change image
- How can I transfer files from one application to another in the same iOS device?
- PhoneGap with Django Backend
- Can I somehow do a synchronous HTTP request via NSURLSession in Swift
- xcode error : Cannot call value of non-function type module Firebase
- “virtual” method's return type in objective-c
- Debugging a library with Xcode
- What is the meaning of the “no index path for table cell being reused” message in iOS 6/7?
- UIWebView Delegate get MIME Type
- App Store – Managing Availability of Your Apps' Previous Versions
- How do I add custom UIButton to nib file in XCode?
- Using NSURLRequest to pass key-value pairs to PHP script with POST