swiftxcodecocoapodsconflict

Swift Version Conflict: this SDK is not supported by the compiler, Please select a toolchain which matches the SDK


I'm using xCode 13.1 with macOS 12.0.1 Monterey. I added KingFisher and removed it from my pod. but my project is not built anymore. I got this error for one of my local SDKs:

Failed to build module 'CbSdk';
this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.4
(swiftlang-1205.0.26.9 clang-1205.0.19.55)', while this compiler is 'Apple Swift version 5.5.1 
(swiftlang-1300.0.31.4 clang-1300.0.29.6)'). Please select a toolchain which matches the SDK.

What I've done but didn't work:


Solution

  • Taken from this Twitter thread.

    You need to set the BUILD_LIBRARY_FOR_DISTRIBUTION build setting on the framework target

    https://www.swift.org/blog/library-evolution/

    https://developer.apple.com/videos/play/wwdc2019/416/

    enter image description here