iosswiftfacebook-ios-sdkxcode13.2

facebook-ios-sdk modules successfully installed but not able to import


I followed the steps as suggested in the official guide to install the packages using the Swift Package Manager and I manually selected the most recent release (currently v12.3.1).

Even though autocomplete shows the modules, and the package has been added successfully to the Package Dependencies, when I try to import a module (e.g. import FBSDKLoginKit) I get the usual No Such Module 'FBSDKLoginKit'.

FYI I am currently using Xcode 13.2.


Solution

  • TL;DR Go to project targets under the "Frameworks, Libraries, and Embedded Content" section of the "General" tab and manually add the modules you need to import.

    After searching around to the official GitHub repo of facebook-ios-sdk, I discovered a note regarding v5.11.0 saying the following:

    users must manually add the Accelerate framework to their targets under the the "Frameworks, Libraries, and Embedded Content" section of the "General" tab

    So I tried checking the "Frameworks, Libraries, and Embedded Content" and discovered that none of the Facebook modules I was trying to import were there, and therefore I manually added them.