4
votes

There are many questions similar to this, but they are mostly talking about this in the context of using cocoapods/carthage. I am not using either and have imported all my frameworks manually.

I am using Xcode 10.1. I just update one of my frameworks to their latest version (we need a feature only available on this version), and am now getting this error message. I also have Xcode 10.2, but the project has 3 other frameworks compiled in Swift 4.2.1 already, and when trying to build with Xcode 10.2 those throw the analogous error (module compiled with swift 4.2.1 cannot be imported by swift 5.0).

Most answers to this question revolve around setting the Swift language version to 4.2.1 for each target. However, since I am not using cocoa pods, I do not see any option in Xcode to change the swift language version of this individual framework. Any ideas? Thanks

1
Swift 4 onwards can be used with Xcode 10.2. I recently updated a Swift 3 project to Swift 4 and now I’m using it with Xcode 10.2.Adeel Miraj
yes, I tried using Xcode 10.2 and setting the project Swift Language version to 4.2, but I still receive "module compiled with swift 4.2.1 cannot be imported by swift 5.0 compiler"jjjjjjjj
I think the problem is these are compiled .framework files, not just regular swift files. They have already been compiled and changing the swift language version in build settings does not affect the individual frameworks.jjjjjjjj
Well @joey, you are right. But if that's the case, you don't have any luck using different version of Swift in your target project. You have to use the exact same version that the frameworks are compiled. This is the downside with compiled frameworks in Swift.nayem
in my case ARVideoKit framework not available in xcode 10.2. but in last xcode, it was available. so there was no solution for that. Please check at your endAjjjjjjjj

1 Answers

0
votes

This error kept showing for me on Xcode version 10.3, even though I had my Swift version in the project set to 4.2. I tried deleting the DerivedData and everything, but to no avail. I installed Xcode 10.1, and it worked perfectly without any issues.