facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.8k stars 3.56k forks source link

Can't use FBSDKLogin using Swift Package Manager #2367

Open OS-ricardomoreirasilva opened 8 months ago

OS-ricardomoreirasilva commented 8 months ago

Checklist before submitting a bug report

Xcode version

15.0

Facebook iOS SDK version

17.0.0

Dependency Manager

SPM

SDK Framework

Login

Goals

I'm building a xcframework that uses FBSDKLogin to provide logins with Facebook.

Expected results

Until 16.3.1 I was able to run my xcframework including FBSDKLogin.

Actual results

After uploading to 17.0.0 and updating my xcframework, when using it, I'm faced with the following error:

Looking into the actual Facebook changes, it appears that FBSDKLogin is now available as a Dynamic instead of a Stack framework. But this change is not mentioned anywhere on the documentation or changelogs. I'd like to understand how can I make it work properly as it was before.

Steps to reproduce

No response

Code samples & details

No response

dolzhenko-tony commented 8 months ago

+1

jorgmateos commented 7 months ago

+1

vahancouver commented 7 months ago

ANY NEWS ON THIS?

dolzhenko-tony commented 7 months ago

My issue was in adding Facebook SDK as dependency to my framework. I transformed it into dynamic Swift Package and issue was solved by spm. Hopefully it will help anybody.

patrikbelis commented 7 months ago

+1

JubeHuang commented 6 months ago

Xcode version 15.1

Facebook iOS SDK version 17.0.1

Same here. I encountered the same issue after uploading from v16.2.1. The project builds successfully, but the app crashes once the ViewController showed up. The error message: dyld[1101]: Library not loaded: @rpath/FBAEMKit.framework/FBAEMKit I would like to know how to solve this error.

spetrov commented 6 months ago

I'm having the same issue with Facebook iOS SDK 17.0.1

JubeHuang commented 6 months ago

I found a workaround solution that might help anyone stuck in the same situation. If you are developing a framework project, add FacebookSDK via SPM or CocoaPods as usual. Then, when you embed your framework into an App project, you need to add FacebookSDK again in the App project. Make sure to check the Framework, Libraries, and Embedded Content section includes Facebook library, so that dyld can locate the file. 截圖 2024-05-24 下午12 07 46

OS-ricardomoreirasilva commented 6 months ago

I found a workaround solution that might help anyone stuck in the same situation. If you are developing a framework project, add FacebookSDK via SPM or CocoaPods as usual. Then, when you embed your framework into an App project, you need to add FacebookSDK again in the App project. Make sure to check the Framework, Libraries, and Embedded Content section includes Facebook library, so that dyld can locate the file. 截圖 2024-05-24 下午12 07 46

Actually, that's not a workaround. It's the proper solution because that is how you work with dynamic frameworks. The thing is, Facebook made this change without providing any evidence or migration documentation to its users, which is a complete lack of respect for its community.