iosfacebookswift-package-manager

How can I upgrade to Facebook iOS SDK v18.0.0 using Swift Package Manager?


I'm trying to upgrade the Facebook iOS SDK in my Swift-based iOS app using Swift Package Manager (SPM). Currently, my project is locked at version 14.1.0 with the rule set to Up to Next Major Version.

I can see from the official repository (https://github.com/facebook/facebook-ios-sdk) that version v18.0.0 is already available. But in Xcode’s Swift Packages UI, I can’t select or update to v18. It’s limited to <15.0.0.

Here’s what I’ve tried:

• Removing and re-adding the package

• Cleaning DerivedData

• Manually entering the GitHub URL again

• Update Packages

How can I update the Facebook SDK to version 18 via SPM? Is there something blocking it (e.g., missing tag, metadata issue, incompatible interface)? Any help is appreciated.


Solution

  • The strategy .upToNextMajor(from: "14.1.0") allows updates to any version with the same major value, i.e. 14.x.x.

    In the case of Facebook-ios-sdk, the last version with major 14 was 14.1. The next release was 15.0.0. That's why you are locked on version 14.1.0.

    You need to update the major version of the dependency manually. Example:

    .upToNextMajor(from: "18.0.0")