How to Update Swift from 3.1 to 3.2, But Not to 4.0

Module compiled with Swift 4.0 cannot be imported in Swift 3.2.1

Swift 4.0 is compatible with Swift 3.2 only.

Swift 4.0.1 is compatible with Swift 3.2.1 only.

So:

  • you can't mix 4.0 and 3.2.1
  • you can't mix 4.0.1 and 3.2
  • you can't mix 4.0 and 4.0.1
  • you can't mix 3.2.1 and 3.2

To formulate it differently:

  • you can mix Xcode 9.0 supported Swift versions together
  • you can mix Xcode 9.1 supported Swift versions together
  • you can't mix Xcode 9.0 and Xcode 9.1 Swift versions

If the module was built by you, simply rebuild it with the same Xcode.

If the module was built by a third party, request an Xcode 9.1 compatible build.

XCode - upgrade to Swift 4 manually


I have updated the "Swift Language Version" in Build Settings of the second target to Swift 4.0 manually

Check the Swift 3 @objc inference is set to off.

Other than that, you are good to go.

Module compiled with Swift 4.0 cannot be imported in Swift 3.2.2: AudioKit

First If you update the Xcode the Xcode-> preferences-> LocationsTab and change the command line tolls Xcode version.. Now check here
AudioKitReleases

pod 'AudioKit', '~> 4.0.3' 

AudioKit V4.0.3 for Xcode 9.1 Pod version according to your Swift language, and update your AudioKit pod by command pod update AudioKit

Realm's Swift module compiled with Swift 4.0 cannot be imported in Swift 4.0.2

I had the same issue, but with the module SocketIO. Recompiling the framework with Carthage worked for me. After that I also had to clean the build folder.



Related Topics



Leave a reply



Submit