Open salahelsayed99 opened 1 year ago
is anyone working on a fix for this? This happens on Intel mac and this is pretty huge problem with current SDK version.
is anyone working on a fix for this SDK? This happens on Intel mac and this is pretty huge problem with current SDK version.
blocked by this issue for a while and still waiting for a proper fix
xcode 14.2, project compiled from unity, same issue, manual adding works, but not good solution
+1 Same issue
+1 Same Issue
+1 Same Issue
I just add
FBSDKCoreKit
andFBSDKCoreKit_Basics
and it works 🙌🏼
I tried this and get an error below:
Multiple commands produce '/Users/jsmglorenzo/Library/Developer/Xcode/DerivedData/Runner-feevmrclfhykhyhhhrdtlavvyvge/Build/Products/Debug-development-iphoneos/Runner.app/Frameworks/FBSDKCoreKit_Basics.framework'
Anyone else face this?
Edit: After downgrading to 14.1.0 like someone mentioned above, I am also getting an issue with not found symbols:
dyld[52084]: Symbol not found: (_$s8FBAEMKit11AEMReporterCN)
Referenced from: '/private/var/containers/Bundle/Application/BBFBF781-7C77-43D5-BC32-3C0CB37D6FF1/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit'
Expected in: '/private/var/containers/Bundle/Application/BBFBF781-7C77-43D5-BC32-3C0CB37D6FF1/Runner.app/Frameworks/FBAEMKit.framework/FBAEMKit'
Using: MacOs Monterey 12.3.1 Flutter 3.3.10 • channel stable Dart 2.18.6 • DevTools 2.15.0 Xcode 13.4.1
@jml0123 After adding these to Frameworks, Libraries, and Embedded Content
, you may have to remove them from Build Phases
-> Link Binary With Libraries
, so it's only in the Embed Frameworks
build phase.
Note that you may also have to add FBSDKGamingServicesKit
as well, at least I had to. Try without it first.
This worked for some, but not all of my projects.
I would really love for this to be resolved ASAP because it's blocking a ridiculous number of people. I'm not sure how I can help, but if anyone points me in the right direction I'm more than happy to give it a go.
@Definitely-Not-Vlad thanks for the tip! Unfortunately this alone didn't work for me. What finally worked using the 15.1.0 version was also to remove FBSDKCoreKit.framework
from the [CP] Embed Pods Frameworks
-> Output Files
under Build Phases
To recap in case someone is facing the same issue:
FBSDKCoreKit_Basics
and FBSDKCoreKit
to Frameworks, Libraries and Embedded Content in General
FBSDKCoreKit_Basics
and FBSDKCoreKit
from Build Phases
-> Link Binary With Libraries
FBSDKCoreKit.framework
from Build Phases
-> [CP] Embed Pods Frameworks
-> Output Files
To recap in case someone is facing the same issue:
- I added
FBSDKCoreKit_Basics
andFBSDKCoreKit
to Frameworks, Libraries and Embedded Content inGeneral
- Removed
FBSDKCoreKit_Basics
andFBSDKCoreKit
fromBuild Phases
->Link Binary With Libraries
- Removed reference to
FBSDKCoreKit.framework
fromBuild Phases
->[CP] Embed Pods Frameworks
->Output Files
@jml0123 Thanks! This is working for me. I'll write down what i did to make it work. I'm building iOS from Unity.
My environment:
Process:
module 'FBSDKCoreKit' not found
error
(This may only apply to Unity users)General
-> Frameworks, Libraries, and Embedded Content
FBSDKCoreKit_Basics.xcframework
FBSDKCoreKit.xcframework
FBSDKGamingServicesKit.xcframework
Build Phases
-> Link Binary With Libraries
FBSDKCoreKit_Basics.xcframework
FBSDKCoreKit.xcframework
FBSDKGamingServicesKit.xcframework
Build Phases
-> [CP] Embed Pods Frameworks
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSDKCoreKit_Basics.framework
I just add
FBSDKCoreKit
andFBSDKCoreKit_Basics
and it works 🙌🏼I tried this and get an error below:
Multiple commands produce '/Users/jsmglorenzo/Library/Developer/Xcode/DerivedData/Runner-feevmrclfhykhyhhhrdtlavvyvge/Build/Products/Debug-development-iphoneos/Runner.app/Frameworks/FBSDKCoreKit_Basics.framework'
Anyone else face this?
Edit: After downgrading to 14.1.0 like someone mentioned above, I am also getting an issue with not found symbols:
dyld[52084]: Symbol not found: (_$s8FBAEMKit11AEMReporterCN) Referenced from: '/private/var/containers/Bundle/Application/BBFBF781-7C77-43D5-BC32-3C0CB37D6FF1/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' Expected in: '/private/var/containers/Bundle/Application/BBFBF781-7C77-43D5-BC32-3C0CB37D6FF1/Runner.app/Frameworks/FBAEMKit.framework/FBAEMKit'
Using: MacOs Monterey 12.3.1 Flutter 3.3.10 • channel stable Dart 2.18.6 • DevTools 2.15.0 Xcode 13.4.1
Just add FBSDKCoreKit.xcframework, not _Basics
Same here with M1 Macbook & Xcode 14.1. Do you guys planning to fix this issue?
M1 Mac, using FBSDKCoreKit (only for analytics) via cocoapods. I too had to add the xcframework explicitly to my main project/target frameworks and embed & sign it to get past the crash. Please fix this. libs included via cocoapods should be built into the pod framework and included that way.
The same issue I can reproduce on my environment:
I was able to fix the problem by updating:
It is an official library maintained by Facebook, so ridiculous that it is not fixed by now.. Are we expected to downgrade the library version then?
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.
To recap in case someone is facing the same issue:
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:
[PostProcessBuild(1000)]
to control when this script is being executed in the list of other post process build scripts.
The method AddFileToEmbedFrameworks
doesn't seem to be available in newer Unity versions, so it might have to be replaced something else.
Correct code for adding facebook's frameworks (working):
[PostProcessBuild(1000)]
public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject) {
if (buildTarget != BuildTarget.iOS) return;
//Debug.Log("Applying Facebook SDK 15.1.0 workaround. Remove me once Facebook has patched this.");
string projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
PBXProject project = new PBXProject();
project.ReadFromFile(projectPath);
string mainTargetGuid = project.GetUnityMainTargetGuid();
List<string> frameworks = new List<string> {
"FBSDKCoreKit",
"FBSDKGamingServicesKit"
};
foreach (string framework in frameworks) {
string frameworkName = framework + ".xcframework";
var src = Path.Combine("Pods", framework, "XCFrameworks", frameworkName);
var frameworkPath = project.AddFile(src, src);
project.AddFileToBuild(mainTargetGuid, frameworkPath);
project.AddFileToEmbedFrameworks(mainTargetGuid, frameworkPath);
}
// Write.
project.WriteToFile(projectPath);
}
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.
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.
Was there a particular reason why you added the (1000) attribute?
No :) just to make sure it executes last.
On my end, I have to change podfile, and change FBSDKCoreKit to version 15
pod 'FBSDKCoreKit', '~> 15.1'
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.
On my end, I have to change podfile, and change FBSDKCoreKit to version 15
pod 'FBSDKCoreKit', '~> 15.1'
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 Frameworks, Libraries, and Embedded Content
is causing build failure in CI systems.
Got if fixed by upgrading Cocoapod from 1.11.2 to 1.12.0.
Xcode version: 14.3 MacOS Version: Ventura 13.3 (22E252) Chip: Intel Core i7
As @hochungwong mentioned, when i upgrade cocoapods to 1.12.0 (mine was 1.11.3), its fixed.
use_frameworks!
use_modular_headers!
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
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
Got if fixed by upgrading Cocoapod from 1.11.2 to 1.12.0.
It works for me.
Xcode version: 14.3 (14E222b) MacOS: Ventura 13.3.1 (22E261) Processor: Intel Core i9
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