-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
dyld[38703]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit #2121
Comments
same |
same here |
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.
|
i use swift |
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: |
|
My mac: Mac pro (2014 mid) Processor 2.5 GHz Quad-Core Intel Core i7 |
the same for me. adhoc works, but release config crash on start with
|
The same, tried to change different rpaths, nothing helped |
+1 here
|
downgrade to |
+1 |
same +1 |
same error |
same here |
Embedded Binaries field and add the required framework not work |
salahelsayed99 thanks for opening this issue! Can you provide a sample project or Podfile to help reproduce? |
Try Installing with SPM |
what's SPM? |
Swift Package Manager |
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. |
I have 2 Macs, but error only happens on old mac. Here is a detailed error message.
|
news about this? Same issue here. |
Same issue here. I have severe problems to get the SDK work with Unity 2019.4.40. I was forced to upgrade, because targeting Android 12 is now required by Google, and this broke the older Facebook SDK version 8 I was using. Upgrading for Android was already a nightmare. Now that I finally got this working, I ran into the iOS crash bug described here. Facebook's QA team seems to have serious issues. And they don't even seem to care about error reports. We're actually thinking about removing Facebook login from our app altogether. This takes up way too much dev time. |
Thanks for the writeup. However, these manual tasks are unbearable if you're building new app versions often. Did you ever manage to automate this via Unity build scripts? |
I was finally able to create a build script that resolved the problem for me on Unity 2019.4: #if UNITY_IOS
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEditor.iOS.Xcode.Extensions;
using UnityEngine;
using System.Collections.Generic;
#endif
public class FixFacebookSDK15_1
{
#if UNITY_IOS
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget target, string buildPath) {
if (target != BuildTarget.iOS) return;
Debug.Log("Applying Facebook SDK 15.1.0 workaround. Remove me once Facebook has patched this.");
string pbxProjectPath = PBXProject.GetPBXProjectPath(buildPath);
PBXProject proj = new PBXProject();
proj.ReadFromFile(pbxProjectPath);
string targetGuid = proj.GetUnityFrameworkTargetGuid();
string mainTargetGuid = proj.GetUnityMainTargetGuid();
List<string> frameworks = new List<string>();
frameworks.Add("FBSDKCoreKit");
frameworks.Add("FBSDKGamingServicesKit");
foreach (string framework in frameworks) {
var fileName = framework + ".xcframework";
var src = Path.Combine("Pods", framework, "XCFrameworks", fileName);
var fullSrc = Path.Combine(buildPath, src);
var dest = Path.Combine("Frameworks", fileName);
var findBefore = proj.FindFileGuidByProjectPath(src);
var name = proj.AddFile(src, src);
proj.AddFileToBuild(targetGuid, name);
var findAfter = proj.FindFileGuidByProjectPath(src);
proj.AddFileToEmbedFrameworks(mainTargetGuid, name);
}
proj.WriteToFile(pbxProjectPath);
}
#endif
} Not sure if this is a generic solution, but my app did not crash anymore. I only added two of the frameworks and was even able to use Facebook Login with this configuration. You might want to add more in your case if needed. In case you are experiencing issues with other frameworks, you might want add a sequence number to the PostProcessBuild attribute, e.g. like this:
to control when this script is being executed in the list of other post process build scripts. The method |
Correct code for adding facebook's frameworks (working):
|
Ah, sorry, I kept some debug stuff in accidently. Glad you corrected the code. |
Are you sure your code actually works? IIRC, I had to add the frameworks to the UnityFrameworkTarget as well. |
Yes.This is the working code. I spent a couple of days trying to fix this issue so that the app doesn't crash. |
Ok, I can confirm it works on both 2019.4.31 and 2021.3.16. And it's simpler. Was there a particular reason why you added the (1000) attribute? |
Just realized that on Unity 2021, you need to add more frameworks. Here's my updated code: #if UNITY_IOS
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEditor.iOS.Xcode.Extensions;
using UnityEngine;
using System.Collections.Generic;
#endif
// https://github.com/facebook/facebook-ios-sdk/issues/2121
public class FixFacebookSDK15_1
{
#if UNITY_IOS
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget target, string buildPath) {
if (target != BuildTarget.iOS) return;
Debug.Log("Applying Facebook SDK 15.1.0 workaround. Remove me once Facebook has patched this.");
string pbxProjectPath = PBXProject.GetPBXProjectPath(buildPath);
PBXProject proj = new PBXProject();
proj.ReadFromFile(pbxProjectPath);
string mainTargetGuid = proj.GetUnityMainTargetGuid();
List<string> frameworks = new List<string>();
frameworks.Add("FBSDKCoreKit");
frameworks.Add("FBSDKGamingServicesKit");
frameworks.Add("FBAEMKit");
frameworks.Add("FBSDKCoreKit_Basics");
frameworks.Add("FBSDKLoginKit");
frameworks.Add("FBSDKShareKit");
foreach (string framework in frameworks) {
var fileName = framework + ".xcframework";
var src = Path.Combine("Pods", framework, "XCFrameworks", fileName);
var fileGuid = proj.AddFile(src, src);
proj.AddFileToBuild(mainTargetGuid, fileGuid);
proj.AddFileToEmbedFrameworks(mainTargetGuid, fileGuid);
}
proj.WriteToFile(pbxProjectPath);
}
#endif
} With this setup, Facebook login is working. Not sure if you need even more frameworks if you're using other stuff. Interestingly, not even FBSDKLoginKit was needed on Unity 2019.4, although login worked fine. |
No :) just to make sure it executes last. |
On my end, I have to change podfile, and change
|
I thought I had fixed this using the script above. The builds ran through and everything worked fine on my iPhone. But now I wanted to push the version the app store. When uploading the build to the store, I got an error message: It goes on like this: This is for Unity 2019.4. On 2021.3, I am getting an additional error messages, which is related to Unity's own Framework: It tells me that UnityFramework.framework it has a disallowed file "Frameworks". WTF?! Any idea what is going on here and why the frameworks are in the wrong folder?! This is really driving me nuts. We have an important release soon, and it bugs if you notice something like this when trying to push your stuff to the stores... I wish we never integrated that crappy Facebook stuff in the first place. |
Ok, I was able to fix the double reference to the Facebook libraries. This was actually an error in my post build script. Here's the updated version: #if UNITY_IOS
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEditor.iOS.Xcode.Extensions;
using UnityEngine;
using System.Collections.Generic;
#endif
// https://github.com/facebook/facebook-ios-sdk/issues/2121
public class FixFacebookSDK15_1
{
#if UNITY_IOS
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget target, string buildPath) {
if (target != BuildTarget.iOS) return;
Debug.Log("Applying Facebook SDK 15.1.0 workaround. Remove me once Facebook has patched this.");
string pbxProjectPath = PBXProject.GetPBXProjectPath(buildPath);
PBXProject proj = new PBXProject();
proj.ReadFromFile(pbxProjectPath);
string mainTargetGuid = proj.GetUnityMainTargetGuid();
List<string> frameworks = new List<string>();
frameworks.Add("FBSDKCoreKit");
frameworks.Add("FBSDKGamingServicesKit");
frameworks.Add("FBAEMKit");
frameworks.Add("FBSDKCoreKit_Basics");
frameworks.Add("FBSDKLoginKit");
frameworks.Add("FBSDKShareKit");
foreach (string framework in frameworks) {
var fileName = framework + ".xcframework";
var src = Path.Combine("Pods", framework, "XCFrameworks", fileName);
var fileGuid = proj.AddFile(src, src);
proj.AddFileToEmbedFrameworks(mainTargetGuid, fileGuid);
}
proj.WriteToFile(pbxProjectPath);
}
#endif
} The culprit was this line: proj.AddFileToBuild(mainTargetGuid, fileGuid); |
There are still two issues that require manual tweaks:
I'm now trying to find a way to automate these two steps. If any of these is missing, publishing to the AppStore will fail. |
I had the same version but it was giving me error now trying to change to older version |
Same issue on Unity Facebook SDK 15.1 |
Got fixed after updating Cocoapod to 1.12.0. Adding FBSDKCoreKit_Basics.xcframework in |
Got if fixed by upgrading Cocoapod from 1.11.2 to 1.12.0. Xcode version: 14.3 |
As @hochungwong mentioned, when i upgrade cocoapods to 1.12.0 (mine was 1.11.3), its fixed.
|
Any update on this issue ? |
seems to be fixed after upgrading cocoapods to 1.12.1 (flutter+facebook_app_events), so can confirm what @hochungwong & @devibrahimkarahan wrote |
It works for me |
It works for me. Xcode version: 14.3 (14E222b) |
Same issue on MacOS Sonoma. Upgrading the cocoapods to the latest version didn't help. Terrible facebook. Your SDK give us so much tired. We need to upgrade it constantly just to use your sign in feature? and your sdk breaks our project. Wtf? |
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
The text was updated successfully, but these errors were encountered: