Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.5.1 compiler, Xcode 13.1 Error

So basically I faced this error on Xcode 13.1 and tried building the 3.5 to 4.2 version but did not get built. Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.5.1 compiler: /Users/Documents/Workspace/Project/Carthage/Build/iOS/ObjectMapper.framework/Modules/ObjectMapper.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

Currently same error with github "Hearst-DD/ObjectMapper" "3.5.3" to github "Hearst-DD/ObjectMapper" "4.2.0" System: macOSBigSur: 11.6 (20G165) Could anyone please help me on this? I tried a couple of StackOverflow answers but does not seem to be working. Tried with NEW BUILD SYSTEM vs LEGACY BUILD SYSTEM. and some options in build settings.

Replies

Your library needs to be built from source as part of your project, or if it's a pre-compiled library, it must be built as an XCFramework. Swift has never guaranteed that compiled modules are compatible across complier versions outside of following those two options.

same problem +1