i am trying to add library react-native-fbsdk-next
to my react native app to make a log in with facebook button. I followed install instruction of facebook to set up Facebook SDK for iOS. The app successfully built, however, I got this error:
dyld[54430]: Library not loaded:
@rpath/FBSDKCoreKit.framework/FBSDKCoreKit
Referenced from: /Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/react_native_fbsdk_next.framework/react_native_fbsdk_next
Reason: tried: '/Users/user/Library/Developer/Xcode/DerivedData/eCommercialApp-dehghjkotvmxkidrbfdhdrffgutk/Build/Products/Debug-iphonesimulator/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Users/user/Library/Developer/Xcode/DerivedData/eCommercialApp-dehghjkotvmxkidrbfdhdrffgutk/Build/Products/Debug-iphonesimulator/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/react_native_fbsdk_next.framework/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file)
Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
Referenced from: /Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-4795-8218-83D7D7F9F778/eCommercialApp.app/Frameworks/react_native_fbsdk_next.framework/react_native_fbsdk_next
Reason: tried: '/Users/user/Library/Developer/Xcode/DerivedData/eCommercialApp-dehghjkotvmxkidrbfdhdrffgutk/Build/Products/Debug-iphonesimulator/FBSDKCoreKit.framework/FBSDKCoreKit' (file does not start with MH_MAGIC[_64], file does not start with MH_MAGIC[_64], fat file, but missing compatible architecture (have 'arm64,x86_64', need 'x86_64')), '/Users/user/Library/Developer/Xcode/DerivedData/eCommercialApp-dehghjkotvmxkidrbfdhdrffgutk/Build/Products/Debug-iphonesimulator/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/user/Library/Developer/CoreSimulator/Devices/B0556C9E-4F68-4C77-9C53-17AC58D85278/data/Containers/Bundle/Application/97EBA641-370F-47
(lldb)
I have spent two days to fix this issue but nothing happened. So everyone have an answer please help me. I am appreciated for your response
2
Answers
I had the same problem. This answer helped me.
In your project select General and Frameworks, Libraries, and Embedded Content. Click plus icon and manually add FBSDKCoreKit with .xcframework extension. Check the Xcode console for errors, add more frameworks if needed.
Refer to my settings on the screenshot below.
Hope it helps.
I had the same problem.You can refer Facebook-ios-sdk