Skip to content

How to fix issue after updating the version of Xcode (Module compiled with Swift x.x.x cannot be imported by the Swift y.y.y)

Alexander Boldyrev edited this page Nov 8, 2022 · 1 revision

Error can look like this (when you've updated Xcode from 12.x to 13.x version):

/platforms/ios/NotificationExtension/NotificationService.swift:4:8: Module compiled with Swift 5.3.2 cannot be imported by the Swift 5.5.1
compiler: Build/Products/Debug-iphoneos/MobileMessaging.framework/Modules/MobileMessaging.swiftmodule/armv7-apple-ios.swiftmodule

To solve it either reinstall the MobileMessaging plugin or rebuild MobileMessaging.xcframework using new Xcode version:

  1. Check that new Xcode Command Line Tools (Xcode->Preferences->Command Line Tools) have the same version.
  2. Check from command line that Xcode path is set to new Xcode (xcode-select -p)
  3. Delete folder YourApp/plugins/com-infobip-plugins-mobilemessaging/libs/ios/Carthage
  4. run script YourApp/plugins/com-infobip-plugins-mobilemessaging/scripts/build_mobile_messaging_framework.sh from your application folder (YourApp)
  5. Replace YourApp/platforms/ios/<Your App Name>/Plugins/com-infobip-plugins-mobilemessaging/MobileMessaging.xcframework with one from folder YourApp/plugins/com-infobip-plugins-mobilemessaging/libs/ios/Carthage/Build
Clone this wiki locally