I'm building a React Native app. To use Facebook Login I added the Facebook SDK to my app. During development on iOS and both during development and production on Android everything worked perfectly fine.
But when I followed this guide from the docs to build the release build of my app for production, I see the following error:
// ... more of the 'duplicate' messages
duplicate symbol _OBJC_IVAR_$_FBSDKAppInviteContent._appLinkURL in:
/Users/<me>/Library/Developer/Xcode/DerivedData/<appname>-cbmpafcjctjlojapgnzaxdbmmopf/Build/Products/Release-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
/Users/<me>/Startup/react-native/<appname>/ios/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
duplicate symbol _OBJC_IVAR_$_FBSDKAppInviteContent._appInvitePreviewImageURL in:
/Users/<me>/Library/Developer/Xcode/DerivedData/<appname>-cbmpafcjctjlojapgnzaxdbmmopf/Build/Products/Release-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
/Users/<me>/Startup/react-native/<appname>/ios/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
ld: 1164 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I googled this error but couldn't find anything about this. What is going wrong? Why does this error only occur when building for production?