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

dyld[38703]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit #2121

Open salahelsayed99 opened 2 years ago

salahelsayed99 commented 2 years ago

Checklist before submitting a bug report

Xcode version

Version 13.1

Facebook iOS SDK version

15.0.0

Dependency Manager

CocoaPods

SDK Framework

Core

Goals

Avoid crash the app when i use the "15.0.0" version of sdk, if i used an oldest version everything is fine.

Expected results

Avoid crash

Actual results

App crashes in the beginning when i used "15.0.0" version of sdk, if i used an oldest version everything is fine.

I tried to use "use_modular_headers!". I tried to delete derived data.

Steps to reproduce

No response

Code samples & details

No response

tallot13 commented 2 years ago

same

abbassk commented 2 years ago

same here

cristian1980 commented 2 years ago

I encountered the same issue. Are you guys using obj-C/C++ ?

I was hoping this was the issue for me. On the mainpage of this GIT there is a warning that I should start writing some wrappers around FB code.

⚠️ Be Advised ⚠️

We have begun rewriting the iOS SDK in Swift in order to modernize the code base.Please monitor the changelog for updates to existing interfaces but keep in mind that some interfaces will be unstable during this process. As such, updating to a minor version may introduce compilation issues related to language interoperability. Using symbols now defined in Swift may require using @import syntax from Objective-C and using C++ will likely require workarounds like creating wrappers in Objective-C.Please bear with us as we work towards providing an improved experience for integrating with the Facebook platform.

tallot13 commented 2 years ago

i use swift

christinachanhk commented 2 years ago

Will that be the reason on old cores?

As I got 2 Macs, the one with M1 Pro core works fine, but the other with old core encounter the same error.

The Mac with old core: Mac mini (2018) Processor 3.2 GHz 6-Core Intel Core i7

feroenmmek commented 2 years ago

Will that be the reason on old cores?

As I got 2 Macs, the one with M1 Pro core works fine, but the other with old core encounter the same error.

The Mac with old core: Mac mini (2018) Processor 3.2 GHz 6-Core Intel Core i7

salahelsayed99 commented 2 years ago

Will that be the reason on old cores?

As I got 2 Macs, the one with M1 Pro core works fine, but the other with old core encounter the same error.

The Mac with old core: Mac mini (2018) Processor 3.2 GHz 6-Core Intel Core i7

My mac: Mac pro (2014 mid) Processor 2.5 GHz Quad-Core Intel Core i7

astrokin commented 2 years ago

the same for me. adhoc works, but release config crash on start with

DYLD error: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit + 0
Pashkagreen commented 2 years ago

The same, tried to change different rpaths, nothing helped

peterpaulis commented 2 years ago

+1 here

dyld[27349]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
  Referenced from: <BD0073D3-6A76-337D-8731-43E71FE6EDBC> /private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/DennikN
  Reason: tried: '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/preboot/Cryptexes/OS@rpath/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/System/Library/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache)
Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
  Referenced from: <BD0073D3-6A76-337D-8731-43E71FE6EDBC> /private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/DennikN
  Reason: tried: '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/private/var/containers/Bundle/Application/26C1B8C3-2EA9-49CE-88F6-E06DAEBCF024/DennikN.app/Frameworks/FBSDKCoreKit.framework/FB
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
wangjian201314 commented 2 years ago
image

In your Xcode ,go the General tab of your Main Project.. there you will find an Embedded Binaries field and add the required framework there . Crash will be resolved.

astrokin commented 2 years ago

downgrade to 14.1.0 helped

Pashkagreen commented 2 years ago

downgrade to 14.1.0 helped

+1

clding commented 2 years ago

same +1 xcode13.4.1 + swift + fb15.0.0

lidorf-gurushots commented 2 years ago

same error Xcode 14.0.1 SDK version: 15.0.0 any news about this error?

DIGITALSQUAD commented 2 years ago
image

In your Xcode ,go the General tab of your Main Project.. there you will find an Embedded Binaries field and add the required framework there . Crash will be resolved.

Additionally added FBSDKGamingServicesKit.xcframework fixed this issue. スクリーンショット 2022-10-13 17 06 03

liweican1992 commented 2 years ago

same here down to 14.1.0 helped

FatCat-TT commented 2 years ago

Embedded Binaries field and add the required framework not work in my xcode will build failed info:
duplicate output file on task: ProcessXCFramework Multiple commands produce

joesus commented 2 years ago

salahelsayed99 thanks for opening this issue! Can you provide a sample project or Podfile to help reproduce?

umair-khan97 commented 2 years ago

Try Installing with SPM

djMax commented 2 years ago

what's SPM?

umair-khan97 commented 2 years ago

what's SPM?

Swift Package Manager

djMax commented 2 years ago

Interesting. I'm in a react-native env, via react-native-fbsdk-next, so I don't think that's an option, but it certainly sounds like a plausible explanation as to why it's breaking.

Achilles0509 commented 2 years ago

I have 2 Macs, but error only happens on old mac.

image

Here is a detailed error message.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/5FB219D0-6B8C-4EFC-8B2D-5BB8D9573900/data/Containers/Bundle/Application/A89C2832-022C-43C5-BB30-107DE9587660/Awesome.app/Awesome
Reason: tried: '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/mactron/Library/Developer/CoreSimulator/Devices/5FB219D0-6B8C-4EFC-8B2D-5BB8D9573900/data/Containers/Bundle/Application/A89C2832-022C-43C5-BB30-107DE9587660/Awesome.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/mactron/Libra
(terminated at launch; ignore backtrace)
Achilles0509 commented 2 years ago
image

In your Xcode ,go the General tab of your Main Project.. there you will find an Embedded Binaries field and add the required framework there . Crash will be resolved.

Additionally added FBSDKGamingServicesKit.xcframework fixed this issue. スクリーンショット 2022-10-13 17 06 03

It worked for me, but I don't like this approach. It changes project.pbxproj file, but I don't want to merge changes to main branch. Does anyone have better solution?

khoogheem commented 2 years ago

Same thing on 15.1.0 using pods

MrAbraham98 commented 2 years ago
image

In your Xcode ,go the General tab of your Main Project.. there you will find an Embedded Binaries field and add the required framework there . Crash will be resolved.

its worked for me thnx. my problem is project created m1 arch and i am working on intel arch it seems arch doing conflict.

Achilles0509 commented 2 years ago
image

In your Xcode ,go the General tab of your Main Project.. there you will find an Embedded Binaries field and add the required framework there . Crash will be resolved.

its worked for me thnx. my problem is project created m1 arch and i am working on intel arch it seems arch doing conflict.

Yes, it works, but as I said here it's not recommended way. Do you have better solution?

foermo4-hao commented 2 years ago
image

In your Xcode ,go the General tab of your Main Project.. there you will find an Embedded Binaries field and add the required framework there . Crash will be resolved.

its worked for me thnx. my problem is project created m1 arch and i am working on intel arch it seems arch doing conflict.

Yes, it works, but as I said here it's not recommended way. Do you have better solution? image

Don't want to merge to main too

salahelsayed99 commented 2 years ago

salahelsayed99 thanks for opening this issue! Can you provide a sample project or Podfile to help reproduce?

I am sorry for late reply unfortunately i can't reproduce it but it obviously happened in the newest version but downgrade to 14.1.0 helped

2sem commented 2 years ago

pod 'FBSDKCoreKit', '14.1.0' works target: iOS 13 xcode: 14.1

kidc2458 commented 2 years ago

I found that the content of ios/pods/Target Support Files/Pods-{project name}/Pods-{project name}-framework.sh which was created after running 'pod install' was wrong. I have two mac os that build the same project, and both mac os have the same environment. (maybe) xcode 14.1 mac os 13.0 node 18.12.0 ruby 2.6.10 ... Other than that, the project settings are all the same.

In the build of Mac OS that has the same problem as this issue, the 'install_framework' entry in 'Pods-{project name}-framework.sh' contains the path of FBSDKCorekit.framework It hasn't been done.

All project settings on both Mac OS are the same. Since I use SVN, I have removed all unnecessary files in the project with svn revert, svn cleanup, etc.

But the result of 'pod install' is different.

I'm looking for something that affects 'pod install' among other environment settings.

Please let me know if anything comes to mind.

+

The Mac OS where the issue occurs is Old Mac. (Mac mini 2018 3.2 GHz 6 Core intel core i7) The Mac that produced the correct build is a slightly newer Mac. (MacBook Pro 2019 2.4GHz 8 Core Intel Core i9)

kidc2458 commented 2 years ago

I haven't been able to find the exact cause of this issue in the end. I set up all the environments to build the project from scratch, and in the end I was able to get the right result.

I installed and built the same project on a total of 4 Mac with different specs and it worked on the Mac I mentioned before.

I uninstalled brew, node, cocoapods, ruby, xcode, yarn respectively and reinstalled it.

yhoseph commented 2 years ago

I fixed this issue by running this command "pod install --repo-update"

zeucxb commented 1 year ago

WhatsApp Image 2022-11-11 at 13 33 19

I just add FBSDKCoreKit and FBSDKCoreKit_Basics and it works 🙌🏼

sajibsaha4647 commented 1 year ago

dyld[24623]: Library not loaded: @rpath/FBSDKGamingServicesKit.framework/FBSDKGamingServicesKit .

still i have problem with this . nothing works for me .

sajibsaha4647 commented 1 year ago

WhatsApp Image 2022-11-11 at 13 33 19

I just add FBSDKCoreKit and FBSDKCoreKit_Basics and it works 🙌🏼

in this way dyld[24623]: Library not loaded: @rpath/FBSDKGamingServicesKit.framework/FBSDKGamingServicesKit same i added and it works for me .

triplef commented 1 year ago

I found that the content of ios/pods/Target Support Files/Pods-{project name}/Pods-{project name}-framework.sh which was created after running 'pod install' was wrong.

I also believe that’s the cause: for some reason the script is missing the install_framework call after updating from v14.1.0 to 15.0.0 or 15.1.0:

image

@joesus any idea what might be going on here?

My Podfile looks like this:

source 'https://cdn.cocoapods.org/'
use_frameworks! :linkage => :static

target 'MyApp' do
  platform :ios, '12.2'
  pod 'FBSDKCoreKit'
end
bgoncharuck commented 1 year ago

Same

bastien-shopopop commented 1 year ago

Updating cocoapods from 1.11.2 to 1.11.3 fix the issue for me.

bgoncharuck commented 1 year ago

For Flutter users of flutter_facebook_auth. Temporary fix:

In pubspec.yaml

  flutter_facebook_auth:
    git:
      url: https://github.com/darwin-morocho/flutter-facebook-auth.git
      ref: 1ba68fa7357075740591b31a511bb9ba67c8740c # pragma: allowlist secret
      path: facebook_auth
mtallenca commented 1 year ago

I had 3 macs with XCode 14.1 - all would build / install ipa, 2 of the builds would produce the FBSDKCoreKit error. Running xcode-select --install fixed those 2.

yaoxp commented 1 year ago

Same.

liushengxu commented 1 year ago

We agree with you. Is it resolved ??Dear !!

bgoncharuck commented 1 year ago

Any progress on fixing it?

NamHofstadter commented 1 year ago

Embedded Binaries field and add the required framework not work in my xcode will build failed info: duplicate output file on task: ProcessXCFramework Multiple commands produce

have you fix this?

dragouf commented 1 year ago

Embedded Binaries field and add the required framework not work in my xcode will build failed info: duplicate output file on task: ProcessXCFramework Multiple commands produce

same problem for me... I use flutter library named facebook_app_events. Here is the related ticket (https://github.com/oddbit/flutter_facebook_app_events/issues/279) but I still don't have a fix

NamHofstadter commented 1 year ago

Embedded Binaries field and add the required framework not work in my xcode will build failed info: duplicate output file on task: ProcessXCFramework Multiple commands produce

same problem for me... I use flutter library named facebook_app_events. Here is the related ticket (oddbit/flutter_facebook_app_events#279) but I still don't have a fix

@dragouf I use facebook_app_events too! And also 'flutter_login_facebook' library I have fix it by add just FBSDKCoreKit.xcframework image hope that will help u In other Mac,the 'facebook_app_events' library works just fine without doing anything. But in my Mac,I have to add FBSDKCoreKit.xcframework that's weird,same Mac OS version,same XCode version,same Intel Core. nothing is different! If u find something,Please let me Know

felipe-xavier commented 1 year ago
image

In your Xcode ,go the General tab of your Main Project.. there you will find an Embedded Binaries field and add the required framework there . Crash will be resolved.

This and downgrading are just workarounds, my team has M1 and intel machines which get conflicts when including the SDK manually solution and we'd rather not downgrade the SDK.

M1 machines work fine with SDK 15, but when we add the SDK manually to make intel machines work, it just breaks the M1 machines later due to duplicate entries.

Please, update the SDK with a proper fix.

greymag commented 1 year ago

@joesus is anyone working on a fix for this? This happens on Intel mac and this is pretty huge problem with current SDK version.