Tell Carthage to build dependency using Swift 3.2.2 (NOT Swift 4.0) Tell Carthage to build dependency using Swift 3.2.2 (NOT Swift 4.0) xcode xcode

Tell Carthage to build dependency using Swift 3.2.2 (NOT Swift 4.0)


You say:

  1. your project is compiling in Swift 3.2.2
  2. your dependency, once resolved and downloaded with Carthage, will be compiling in Swift 4 (since its Build Setting was configured in that way)

with those conditions will be impossible for you resolving the issue: you can't mix Swift 3 and 4 due to this:https://github.com/Carthage/Carthage/issues/1978

The only thing you can do, for (eventually) fixing the situation is:


Scenario 1

  1. you should find a previous version of the library which is building in Swift 3.2~, if exists
  2. on your Cartfile you specify that specific version, eg:

    github "yourDependency" == x.y.z


Scenario 2

  1. launch carthage update --platform iOS
  2. enter inside your dependency folder (Carthage/Checkouts/yourDependency) and open the .xcodeproj in order to modify manually this option:

enter image description here

  1. then you might have tons of building problems due to the fact that you are producing a language regression, you can try to fix them (depending by the library if is small or not, it could be possible).
  2. if you have solved the dependencies, then launch:

    carthage build --platform iOS

  3. try to compile your project...


The only workaround for now is to switch to new build system in Xcode. In workspace settings. Or downgrade library version which supports swift 3