1

It seems as though the way the MarketingCloudSDK Swift Package Module is built that it cannot be included in projects that use a different version of the Swift compiler. When trying to use the Swift Package for 8.0.3 in my team's project we get the following error:

Failed to build module 'MarketingCloudSDK'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)', while this compiler is 'Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)'). Please select a toolchain which matches the SDK.

We are building with the latest Xcode, version 13.2.1.

There is an issue on Stack Overflow similar to this with possible resolution steps: https://stackoverflow.com/questions/70556401/swift-version-conflict-this-sdk-is-not-supported-by-the-compiler-please-select

8
  • I was able to build and archive an app with Xcode version 13.2.1 using swift version 5.5.2 and Marketing Cloud SDK 8.0.3. Is there a certain step or setting you are seeing this happen with? Jan 13 at 14:35
  • Our project is very large so to isolate the problem I created a new empty project in Xcode that contained just a view controller and then included the Swift Package and tried to import MarketingCloudSDK and I get the same issue. So I don't believe it is any particular setting in our project.
    – Joey
    Jan 13 at 20:17
  • Perhaps I should add that this is being built on an Intel MacBook for x86_64 simulator.
    – Joey
    Jan 13 at 20:21
  • 1
    I have verified I am using Swift compiler v5.5.2. I noticed on your sample app that you are only pulling in MarketingCloudSDK. That alone will not work. Via the documentation, when moving to MarketingCloudSDK v8.0+, be advised you will also need to bring in the (Core) SFMCSdk swift package. Ref: salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/… Jan 19 at 14:51
  • 1
    Ah! Okay. That fixes it. I totally missed the notes on this migration. I always just reference this page salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS. I think it would be helpful if there was a callout somewhere in the body of that page about migrating with the link (other than just the sidebar). I wasn't aware there was any migration steps to update to from 7.x to 8+. Thanks for the help!
    – Joey
    Jan 19 at 17:19
1

For MarketingCloudSDK v8.x and above you also need to pull in the SFMCSdk Swift package. Migration steps outlined here: https://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/get-started/get-started-migration.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.