0

I am using couchbaselite enterprise in my project. After I upgraded XCODE from 10.3 to 11.2, I got this error message. (Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler)

my podfile is like this:

# Uncomment the next line to define a global platform for your project
# platform :ios, '11'

target 'Imece' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  pod 'SwiftyJSON', '~> 4.2'
  pod 'FSCalendar', '~> 2.7.9'
  pod 'CouchbaseLite-Swift-Enterprise', '~> 2.6.1'
  pod 'Alamofire'
end

I tried below solution bu it did not make any difference. in XCODE change

BUILD_LIBRARY_FOR_DISTRIBUTION = YES;


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

I also tried build the (couchbaselite) framework files as mentioned here
https://github.com/couchbase/couchbase-lite-ios#how-to-build-the-framework-files

But I got BUILD_FAILED error.

Is there any other solution to get rid of this situation?

  • 1
    you should be able to download CBL iOS 2.6.3 binary, which will fix the error. It is already available in Cocoapod, downloads page, Carthage. – Jay Nov 26 '19 at 05:44
  • 1
    Yeah, i just updated my cbl pod to 2.6.3 and error was gone. Thank you – M. Ali Tutal Nov 27 '19 at 19:36

1 Answers1

4

The error means that Couchbaselite framework needs to be built with Xcode 11.2. You cannot change the settings in your app in order to fix it. So your options are to either

  • Waiting for release of Couchbase Lite that will support Xcode 11.2 or
  • Downgrade your Xcode version to Xcode 11.1 (the version compatible with Couchbase Lite 2.6.1). You can download previous version of Xcode from here
rajagp
  • 1,443
  • 8
  • 10