Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode15.3: After updating SDKv17.0.0 through SPM, an error occurred while running the project: dyld [5199]: Library not loaded: @ rpath/FBSDKCoreKit. framework/FBSDKCoreKit, unable to start the application #2385

Closed
5 tasks done
dongxianbin opened this issue Apr 15, 2024 · 18 comments

Comments

@dongxianbin
Copy link

Checklist before submitting a bug report

Xcode version

Version 15.3 (15E204a)

Facebook iOS SDK version

17.0.0

Dependency Manager

SPM

SDK Framework

Core

Goals

Update Facebook iOS SDK version 17.0.0 to adapt to Apple's development privacy list

Expected results

Running normally without any issues

Actual results

dyld[4568]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
Referenced from: /private/var/containers/Bundle/Application/2822F927-C630-4091-A397-90F66483DFEF/FrogJumpGame-mobile.app/FrogJumpGame-mobile
Reason: tried: '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/mutong/Library/Developer/Xcode/DerivedData/FrogJumpGame-gwwoxmkgaezcejfczgbcxcfkukhv/Build/Products/Debug-iphoneos/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/private/preboot/Cryptexes/OS/Users/mutong/Library/Developer/Xcode/DerivedData/FrogJumpGame-gwwoxmkgaezcejfczgbcxcfkukhv/Build/Products/Debug-iphoneos/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/mutong/Library/Developer/Xcode/DerivedData/FrogJumpGame-gwwoxmkgaezcejfczgbcxcfkukhv/Build/Products/Debug-iphoneos/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/private/preboot/Cryptexes/OS/Users/mutong/Library/Developer/Xcode/DerivedData/FrogJumpGame-gwwoxmkgaezcejfczgbcxcfkukhv/Build/Products/Debug-iphoneos/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file)

Steps to reproduce

Import SDKv17.0.0 through SPM and run Xcode

Code samples & details

No response

@dongxianbin dongxianbin reopened this Apr 17, 2024
@dongxianbin dongxianbin changed the title Update Facebook iOS SDK version 17.0.0 to adapt to Apple's development privacy list Xcode15.3: After updating SDKv17.0.0 through SPM, an error occurred while running the project: dyld [5199]: Library not loaded: @ rpath/FBSDKCoreKit. framework/FBSDKCoreKit, unable to start the application Apr 17, 2024
@zhoubo6419
Copy link

I encountered the same problem

Xcode version
Version 15.1 (15C65)

Facebook iOS SDK version
17.0.0

Dependency Manager
Pod

SDK Framework
Core

Goals
Update Facebook iOS SDK version 17.0.0 to adapt to Apple's development privacy list

Expected results
Running normally without any issues

Actual results
dyld[2331]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
Referenced from: /private/var/containers/Bundle/Application/A2B88D97-5F62-4611-B82A-E545864CFB06/xxx.app/xxx
Reason: tried: '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/private/var/containers/Bundle/Application/A2B88D97-5F62-4611-B82A-E545864CFB06/xxx.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/private/var/containers/Bundle/Application/A2B88D97-5F62-4611-B82A-E545864CFB06/xxx.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/private/var/containers/Bundle/Application/A2B88D97-5F62-4611-B82A-E545864CFB06/xxx.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/private/var/containers/Bundle/Application/A2B88D97-5F62-4611-B82A-E545864CFB06/xxx.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/System/Library/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file)

Steps to reproduce
Import SDKv17.0.0 through Pod and run Xcode

Code samples & details
No response

@zhoubo6419
Copy link

截屏2024-04-17 16 18 45 I can solve it this way but I'm worried there will be some problems

@dongxianbin
Copy link
Author

Build Settings -> Runpath Search Paths: @executable_path/Frameworks

@vahancouver
Copy link

Build Settings -> Runpath Search Paths: @executable_path/Frameworks

@dongxianbin Can you please explain? I have my Runpath Search Paths: @executable_path/Frameworks and still getting the same error

@dongxianbin dongxianbin reopened this Apr 18, 2024
@dongxianbin
Copy link
Author

Build Settings -> Runpath Search Paths: @executable_path/Frameworks

@dongxianbin Can you please explain? I have my Runpath Search Paths: @executable_path/Frameworks and still getting the same error

I compared my project with another functioning one and realized that my project was lacking an essential element - Build Settings -> Runpath Search Paths: @executable_path/Frameworks. Upon making this necessary modification, my project started running smoothly.

@zhoubo6419
Copy link

I have my Runpath Search Paths: @executable_path/Frameworks and still getting the same error

@vahancouver
Copy link

vahancouver commented Apr 18, 2024

I have my Runpath Search Paths: @executable_path/Frameworks and still getting the same error

Same for me!

Also worth mentioning that this issue happens while running on a device only (works fine on a simulator)

PS. I'm using SPM

@dongxianbin
Copy link
Author

I don't have any other way. I created a new app using Xcode, imported FBSDKv17.0.0, and then ran it normally. Then, I compared the new Xcode project with my own Xcode project and found a solution. You can also try it out.

@zhoubo6419
Copy link

I'm using pod same problem
截屏2024-04-18 09 47 32

@FabianBartels
Copy link

The same happened to me:

It works fine for the simulator but crashes for the real device.

dyld[9576]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit Referenced from: <6D021832-8211-3954-9421-9B21CE49BB9C> /private/var/containers/Bundle/Application/2CAC9516-6C7B-4460-B4E6-2590A3195984/XXX.app/XXX Reason: tried: '/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-hevagtfawervsfccdbpjpkfiqeqp/Build/Products/Debug-iphoneos/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), ...

Not sure but as i checked my folder structure i detected that the folder .../PackageFrameworks/.. in path /Users/XXX/Library/Developer/Xcode/DerivedData/XXX-hevagtfawervsfccdbpjpkfiqeqp/Build/Products/Debug-iphoneos/PackageFrameworks/FBSDKCoreKit.framework does not even exists so it cant find FBSDKCoreKit.framework there.

However, when navigating to the directory to the parent dir of PackageFrameworks (/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-hevagtfawervsfccdbpjpkfiqeqp/Build/Products/Debug-iphoneos/FBSDKCoreKit.framework) i can find the FBSDKCoreKit.framework.

So far i think i need to find a way to change the dir somehow :).

Letting you know if this is not an dead end.

@vahancouver
Copy link

vahancouver commented Apr 18, 2024

In my case I'm adding the FB SDK via SPM in a framework as a dependency, than using that framework in a an app.
That's when i'm getting this error.

But when I create a brand new app and directly add FB SDK via SPM, I see no issues.

This means something is different when the FB SDK is added to a framework target.
@dongxianbin is this helpful at all? any chance you can test this on your side?

Thanks.

PS. This is a new issue in 17.0.0. It works with no issues on 16.1.0

@dongxianbin
Copy link
Author

@vahancouver ,My original Xcode project was created through Cocos, so there may be some differences in Build Setting compared to normal Xcode projects. I compared the methods you mentioned and found a solution. This issue did not occur before version 17.0.0. Different Xcode projects may have different problems, so it is recommended that if the same problem occurs, you create a new app using Xcode, import FBSDK according to your own method, and then compare the differences between the two projects before, step by step, to modify and test. There is no other good way.

@VikasTTN
Copy link

VikasTTN commented May 2, 2024

I'm also encountering the same problem. After updating SPM to version 17.0.0, the app crashes during launch on iOS 13.

@aleufms
Copy link

aleufms commented May 2, 2024

I'm having the same issue. It's because we do not import the facebook lib directly in our project, but through an module: our app -> libs module (have all the libs through spm) -> facebook sdk.

@VikasTTN
Copy link

VikasTTN commented May 2, 2024

@aleufms any solution for this ?

@aleufms
Copy link

aleufms commented May 2, 2024

@VikasTTN no :(

@aleufms
Copy link

aleufms commented May 2, 2024

@VikasTTN I have workarounded this issue. I have imported the lib in the app too, and it is working on actual devices. Not ideal, but it an temporary solution.

@george-bafaloukas-forgerock

Same issue exists on version 18.0.0 when integrating as part of a module using SPM.

Any solutions @aleufms @dongxianbin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants