Module compiled with Swift 5.0.1 cannot be imported by the Swift 5.1 compiler

I just got my Xcode updated to Xcode 11. But I am not able to build my project as it’s giving the error mentioned below

Module compiled with Swift 5.0.1 cannot be imported by the Swift 5.1 compiler: /Xcode Projects/DigiRecords/drlitenative/Pods/CouchbaseLite-Swift-Enterprise/iOS/CouchbaseLiteSwift.framework/Modules/CouchbaseLiteSwift.swiftmodule/arm64.swiftmodule

When will there be a update in the sdk? As I can’t build the project, I can’t continue my work.

You could head over to the Couchbase Lite GitHub Repo and build the framework locally to continue working today.

While we’re at it, CocoaPods could use an update too. It has lagged behind quite a bit.

We’re hoping to get an Xcode 11 compatible version out this week. Thanks for your patience.

Couchbase Lite 2.6.0 is our latest release. Are you saying our CocoaPods CouchbaseLite is not 2.6.0?

Looks like it’s at 2.6.0 now, but compiled with Swift 5.0.1. When I checked a week or two ago (can’t remember) it was behind, on 2.5.x I think?

2.6.0 was released August 27.

Only hint I can offer is from looking in my local commit history. On Sept 10 I tried to pod update and was still getting 2.5, so I switched to a locally compiled framework. Either way, that’s old news and I’m looking forward to seeing the 2.6.x / Swift 5.1 framework later this week.

Should be there now.

Let us know if there are any issues.

When? How to fix it? Xcode 11

Be sure to clear your cache - couchbase Lite 2.6.1 for iOS should work with Xcode 11.

I can’t download couchbase Lite 2.6.1 in CocoaPods? When I can do it?

If you cannot download it, take it up with CocoaPods. The spec has been there for 4 days at this point

Did you try updating the pod repo?

pod repo update
pod install

1 Like

Another year has passed, got a new Xcode and a new Swift version. Can we get a repo bump again please?

Failed to build module ‘CouchbaseLiteSwift’ from its module interface; the compiler that produced it, ‘Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)’, may have used features that aren’t supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)

Any chance of getting Swift Package Manager support?

@Grimal Could you please provide details of the CBL version you are trying to use, also Xcode version?

CouchbaseLite-Swift-Enterprise (2.7.1)
Xcode Version 12.0 (12A7209)


Make that Xcode Version 12.0.1 (12A7300) now :wink:

I have validated the Xcode 12.0.1 and CouchbaseLiteSwift 2.7.1, using the binary from downloads. Can you explain the steps that cause the issue(explain in a way I can also reproduce the issue) ?

Sorry, been away for the weekend. Just checked today, and I see the CocoaPods repo has been updated to 2.7.1. Thanks!


The downloadable copy on was compiled with Swift 5.3 and indeed works perfectly.

Unfortunately, it appears CBLSwift 2.7.1 uploaded to the CocoaPods repo was still compiled with the old version of Swift (5.2.2) instead of the 5.3 version packaged with Xcode 12.0.x

failed to build module 'CouchbaseLiteSwift' from its module interface; the compiler that produced it, 'Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)

I have created a simple project with the below Podfile, and projects works fine

TestCocoapod 10:39:11 $ pod install
Analyzing dependencies
Downloading dependencies
Installing CouchbaseLite-Swift (2.7.1)
Removing CouchbaseLite-Swift-Enterprise
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] Automatically assigning platform `iOS` with version `14.0` on target `TestCocoapod` because no platform was specified. Please specify a platform for this target in your Podfile. See ``.
TestCocoapod 10:39:20 $ 
TestCocoapod 10:39:20 $ open TestCocoapod.xcworkspace 
TestCocoapod 10:39:25 $ cat Podfile

target 'TestCocoapod' do

  pod 'CouchbaseLite-Swift'

TestCocoapod 10:41:02 $ xcodebuild -version
Xcode 12.0.1
Build version 12A7300

Could you please share the Podfile?