I have create a simple reusable framwork and run that on XCode 9.4.1 and and seprate the .framwork file
When I am using this framwork with XCode 10.1 there is an error coming like
Module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2.1 compiler: /Users/apple/Desktop/projectName/demo.framework/Modules/Demo.swiftmodule/arm64.swiftmodule
Is there any way to use that previous framwork in my latest code, or any other suggestion.
Should I need to compile that framwork on latest XCode 10.1, If yes, does this work on XCode 9.4.1 or lower version.
Related
I am new at developing with Swift so I guess I am missing something...
I have an iOS app built in Swift 3, which is no longer supported in xCode. So I guess I need to migrate to a newer version of swift. Xcode (10.1) suggests Swift 4.2.
But ... There is a dependency which uses Swift 3. I tried recompiling this library (using Xcode 12.1 because I get some built errors in Xcode 10.1). In that project the Swift version is set on Swift 4.2. I compiled the and added the package to the original app.
Now I get an error: Module compiled with Swift 5.3 cannot be imported by the Swift 4.2 compiler.
How can is get the package compiled with Swift 4.2?
Thanks
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
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.
I Created a dynamic framework on Swift 3.2 & Xcode 9.0 and use it in my projects worked fine,
today, I update to Xcode 9.2 & Swift 4.0 so compiled framework on Swift 4.0 and export myFramework.framework so added by embedded Binaries it in project.
This is a strange problem when add new framework with Swift 4.0 not resolve any Framework Classes and get error:
Use of unresolved identifier 'MyClassName'
I tired more solution but no solved my problem.
Note: All of Classes Framework have open access.
Where my Framework Problem?
Is there an easy way to update framework swift version?
The Issue was that I build framework via Generic iOS Device If it should compiled on iOS Simulators like iPhone SE or iPhone 8.
I build framework on one of iOS Simulator Device and import in project.
I'm using Swift 2.3 on Xcode 7.3.1 and when in AppDelegate I'm trying to import
import UserNotifications
it gives me the error that "No such module UserNotifications". What is the problem and how can I fix that?
I've tried to run it on Xcode 8 with defined SWIFT_VERSION = 2.3, but I get a lot of errors in Alamofire framework, but I set inside of Alamofire swift version, too. So I decided to continue working on Xcode 7.
So, is it because of Xcode versions or I can fix that on Xcode 7, too? My target iOS is 10. I copied inside of supported platforms 10.2 folder, so I can run on iOS 10 device from Xcode 7
You can't simply mix swift2.3 and swift3 in a single project within single target and this is also not a recommended approach.
The error which you are getting is due to UserNotifications framework. This framework has been added in xcode8 so you can't use this framework in xcode7.3.1 .
Also if you are planning to use swift2.3 in Xcode 8 then you have to use Legacy Swift Version if you made it yes then you will be able to run your project which is in swift2.3, but you will be not able to use syntax of swift3.
TO open swift 2.3 project in xcode 8, you have to on legacy form build setting for target and alamofire both.
I'm using Xcode 7.3 but my project is in Swift 2.1. I don't want to update my codes right now. So how can I choose or download older version of Swift compiler? Many thanks in advance!
The following example is tested on Xcode 8.3 with swift 3.1
If you are using Xcode 8 you can download toolchains with needed Swift versions
1) Open this link:
https://swift.org/download/#releases
2) Download Toolchain with swift version that you need. For example I have 3.1 version of swift and downloaded swift 3.0.2
3) Open .pkg file and install it.
4) Open Xcode and select in menu:
Xcode -> Toolchains -> Select Swift Version you need.
That is all folks
Originally I posted this is a comment, but I should have just posted it as an answer:
If you're writing an app for the App Store, you can only use a release (non-beta) version of Xcode (see “Submitting Apps to the App Store using Xcode”) and the toolchain supplied with that version of Xcode (see “Using Downloads / Apple Platforms”). So you can either use Xcode 7.2 and continue using Swift 2.1, or you can use Xcode 7.3 and update your code to Swift 2.2.
You can have multiple versions of Xcode installed. You can keep Xcode 7.2 installed and use it for your non-updated Swift 2.1 projects, and use Xcode 7.3 on new projects. Note that you'll have to manually open each project in the appropriate version of Xcode. You can download old versions of Xcode here.
If you're not going to put your app in the App Store, then maybe you could extract the Swift 2.1 toolchain from the Xcode 7.2 bundle and turn it into a .xctoolchain for use with Xcode 7.3, but you're really in unexplored, unsupported territory if you go that route.
If you're following the answers involving a .xctoolchain combined with Xcode 9 beta you'll encounter an error similar to this:
<unknown>:0: error: unknown argument: '-index-store-path' Command /Library/Developer/Toolchains/swift-3.1.1-RELEASE.xctoolchain/usr/bin/swiftc failed with exit code 1
The reason is that Apple has added a new feature/argument, which hasn't made its way to open source Swift yet. You can get around this issue by launching Xcode from the command line with the feature disabled like this:
/path/to/Xcode-beta.app/Contents/MacOS/Xcode -IDEIndexEnableBoltIndex NO
Thanks to the Swift team
Xcode 9 - Xcode 10
Select your target, then in your Build Settings, search for "swift language" and then you will find Swift Language Version.