module compiled with swift 5.3.2 cannot be imported by the swift 5.5.2 compiler

Hello, When trying to open a project written in approximately August in xcode 13.2.1 version, I get the error 'module compiled with swift 5.3.2 cannot be imported by the swift 5.5.2 compiler'. As you can see in the attachment, I get 127 errors when I run it with the 5.3.2 toolchain. How can I upgrade an existing project to version 5.5.2? Thank you in advance for your help

Replies

Please see my answer in another thread.

  • i see it but i am already built from source as a part of project.If you add me on discord I can show you my problem in more detail and maybe you can help. i really need it Hazni#7481

  • You can access Apple's official technical support for issues like these by opening a Technical Support Incident.. We do not provide support on Discord.

  • I am getting a similar issue when I switched to Xcode 13.2.1. In my case, I use carthage to build dependencies. And I only get this error when I build it in the AppCenter build server. Locally the build works fine. In both cases, using Xcode 13.2.1.

    My understanding is that carthage will build from source. Any ideas?

Add a Comment

i see it but i am already built from source as a part of project.If you add me on discord I can show you my problem in more detail and maybe you can help. i really need it Hazni#7481

I'm using cocoapods-binary-cache and I'm getting the same error as yours. There is no problem when building with the actual device, but an error occurs when building with the simulator as a target.

Module compiled with Swift 5.3.2 cannot be imported by the Swift 5.5.2 compiler

Environment:

  • Xcode 13.2.1 (13C100)
  • Using a Mackbook Pro (M1 Pro, 10 Core)
  • swift-driver version: 1.26.21 Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
  • Target: arm64-apple-macosx12.0
  • No additional Swift use with other Xcode or Toolchain.

I have faced the same error. An actual device works well but the emulator makes problem.

The errors

<unknown>:0: error: unable to load standard library for target 'arm64-apple-ios12.0'
<unknown>:0: error: module compiled with Swift 5.4 cannot be imported by the Swift 5.5.2 compiler: 

And I tried to change my swift version(5.5.2 -> 5.4) on Xcode via ToolChain, but it does not work.

Environment

  • Xcode: 13.2.1 (13C100)
  • MacBook Pro (MacBook Pro (13-inch, M1, 2020))