Swift in XCode beta


#1

Is there a work around for using CouchbaseLiteSwift in XCode beta? I am getting this error:

Module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2 compiler


#2

The workaround is to compile it from source, and complain to Apple that this has been going on for far too long (every new version of Swift breaks compatibility with the last)


#3

Apple (and the Swift community) have been working on binary stability for a while, but it’s a big complex goal. Until then, all Swift code needs to be compiled with the same version of the compiler. On the other hand, Couchbase is reluctant to release software that was built by an unfinished beta version of Xcode. Sorry for the inconvenience.


#4

I have tried to build the 2.0.3 tag of the swift framework, but I experienced build errors with the new compiler. Would it be better to fix these errors in 2.0.3 or attempt to use master?

Also, I am wondering how some of the other Pods I am using deal with this issue. I am not getting errors from them. Are they just building with the beta XCode? Here is the podfile.

pod ‘CouchbaseLite-Swift’, ‘~> 2.0.0’
pod ‘ZIPFoundation’, ‘~> 0.9’
pod ‘Alamofire’, ‘~> 4.6’
pod ‘FacebookCore’, ‘~> 0.3.1’
pod ‘Fabric’
pod ‘Crashlytics’

Thanks for the help


#5

Don’t use master; that’s for bleeding-edge development. Hopefully the build errors will be simple to fix.

Most pods are built from source, so don’t run into this issue. We don’t do that because building Couchbase Lite is quite complex, and because Couchbase’s build team prefers to be in control of creating the binaries that customers/developer use.


#6

I fixed the build errors for 2.0.3 and everything built ok. Unfortunately, XCode complains of and unknown error when attempting to use the framework.

“Command CompileSwiftSources failed with a nonzero exit code”

I’m not sure if this error while build the framework is an issue or not.
“ld: warning: linking module flags ‘Dwarf Version’: IDs have conflicting values”


#7

Look at the full build log (the right most tab in Xcode’s navigator.)


#8

The error doesn’t seem helpful.

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target: DittyEmojis_MessagesExtension)
cd /Users/brett/Documents/DittyEmojis/DittyEmojis
export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer
export SDKROOT=/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name DittyEmojis_MessagesExtension -Onone -enable-batch-mode -enforce-exclusivity=checked -DDEBUG -D COCOAPODS -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk -target x86_64-apple-ios11.0-simulator -g -module-cache-path /Users/brett/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -application-extension -enable-testing -index-store-path /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Index/DataStore -swift-version 4 -I /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/Alamofire -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/Bolts -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/FBSDKCoreKit -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/FacebookCore -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/GradientProgress -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/MarqueeLabel -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/SwiftyJSON -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/TweenKit -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/ZIPFoundation -F /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/lottie-ios -F /Users/brett/Documents/DittyEmojis/DittyEmojis/Pods/Crashlytics/iOS -F /Users/brett/Documents/DittyEmojis/DittyEmojis/Pods/Fabric/iOS -F /Users/brett/Documents/DittyEmojis/DittyEmojis -c -j4 /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/ExecutionButton.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/CouchbaseDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/EmojiSection.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/FoleyController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/AudioControllerDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Enums/EmojiPackType.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/FocusArea.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/Views/CompositionViewExt.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/EmojiPack.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiTabBar.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiProgressView.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/DittyHelperDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/FocusAreaDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiAnimatingCell.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/Downloader.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/ViewControllers/StickerViewController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/StyleConstants/DEIFont.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/TextViewDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/PlayEQButton.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/ViewControllers/CompositionViewController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/SongInfo.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiCellLoadingView.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/NadaEmojiPack.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/LottieRenderDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiTabButton.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/AnimatedImageView.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/Analytics.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/FocusEntryArea.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/CannedEmoji.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiSnackbar.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/ViewControllers/OnboardingViewController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Models/EmojiCollectionModel.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiCollectionView.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/CBServiceBase.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/CacheHelperBase.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/StaticEmoji.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/NadaEmoji.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/CBService.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/AnimationSync.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/UIHelpers.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/ViewControllers/CompositionViewControllerExt.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/Views/FocusAreaExt.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/SettingsModel.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/EmojiDelegates.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/OutlineButton.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/ViewControllers/DittyMojiViewController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/StyleConstants/DEIAttributedText.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Enums/SettingsKey.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/LottieHelper.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/PurchaseHelper.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/ViewControllers/MessagesViewController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/AnimationHelper.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Models/UserEmoji.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/LottieRenderer.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/AnimationSyncTimerDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/StyleConstants/DEIImage.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/AudioController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/FramesToVideo.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/CannedMarqueeView.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/UIGradientHelpers.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Enums/VisemeTemplate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/CollectionViewSectionHeader.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/HighlightButton.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/VolumeDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/Emoji.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/SolidButton.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/ProgressDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/SongTitleMarqueeView.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Enums/SnackbarGravity.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/MessagesDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Config/AnalyticsTags.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/ViewControllers/DittyMojiViewControllerExt.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/EmojiAlertDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/LottieAnimationController.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/Logging.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/SingingEmoji.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/Helpers/CompositionHelper.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/CacheHelper.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/UIExtensions.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/UserSettings.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/OnboardingViewControllerHelper.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/DittyMojiViewControllerDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/MarqueeLabelExt.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/Views/EmojiStickerCellExt.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiStickerCell.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/Config/ConstantsDittyMojiExt.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/EmojiOrderItem.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/EmojiAssets.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Enums/BodyState.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/LottieLipSync.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/CompositionView.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/FrameCapturer.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/StyleConstants/DEIColor.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/DittyHelper.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/MulticastDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/MiniEmojiCell.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/EmojiAlert.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Delegates/SnackbarListenerDelegate.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/IconButton.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Views/FocusArea/FocusAreaExtensions.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Enums/Orientation.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Helpers/SystemUtils.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/Helpers/IMessageHelpers.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Couchbase/Models/Settings.swift /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyMojiShared/Config/Constants.swift -output-file-map /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/Objects-normal/x86_64/DittyEmojis_MessagesExtension-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/Objects-normal/x86_64/DittyEmojis_MessagesExtension.swiftmodule -Xcc -I/Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/DittyEmojis_MessagesExtension-generated-files.hmap -Xcc -I/Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/DittyEmojis_MessagesExtension-own-target-headers.hmap -Xcc -I/Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/DittyEmojis_MessagesExtension-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/DittyEmojis_MessagesExtension-project-headers.hmap -Xcc -I/Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/DerivedSources/x86_64 -Xcc -I/Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -emit-objc-header -emit-objc-header-path /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/DittyEmojis.build/Debug-iphonesimulator/DittyEmojis_MessagesExtension.build/Objects-normal/x86_64/DittyEmojis_MessagesExtension-Swift.h -import-objc-header /Users/brett/Documents/DittyEmojis/DittyEmojis/DittyEmojis_MessagesExtension/DittyEmojis_MessagesExtension-Swift.h -pch-output-dir /Users/brett/Library/Developer/Xcode/DerivedData/DittyEmojis-eosolxkkhwwhrwfobmxagllvoljo/Build/Intermediates.noindex/PrecompiledHeaders -working-directory /Users/brett/Documents/DittyEmojis/DittyEmojis

Command CompileSwiftSources failed with a nonzero exit code

When running the same command in terminal I only get a bunch of these errors:
{
“kind”: “signalled”,
“name”: “compile”,
“pid”: -1079,
“error-message”: “cancelled batch constituent”,
“signal”: 2
}
127
{
“kind”: “signalled”,
“name”: “compile”,
“pid”: -1080,
“error-message”: “cancelled batch constituent”,
“signal”: 2
} …


#9

Yuck. I haven’t seen this exact situation before, but when Weird Stuff like this happens, I usually quit Xcode, delete the project’s entire build directory, and then try to build again.