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
Undefined symbol: swiftCompatibility #450
Comments
Current workaround is adding |
Thanks @KylinChang it worked for me! |
Thanks @KylinChang , |
Wow thanks so much, you should definitely add something to the change log. |
after adding use_frameworks! the project builds, but crashes on start with this error: Adding it to the list of embedded frameworks didn't help. Anything else I need to do? |
It's not working for me! I added "use_frameworks!" but the build still fails. Do I need something else? |
I get the same thing :/ @KylinChang can you share what your podfile looks like please? |
I was able to build it now, but it fails with the same error when running. Anybody was able to make it work? |
Same problem here with Unity 2019.4.1, Facebook SDK 7.21.1. Using Having to manually modify the podfile and then the project is something that we should not have to do for such an easy task as simply integrating the Facebook SDK... |
Here you can setup a simple post build script to modify the podfile programmatically, I use it in my project and it works just fine using System.Collections; public class PostProcessBuild_Podfile : MonoBehaviour
} |
@Khaled-Wolf thanks for the code, that's really useful, but still even if this makes the project compile then the framework are not embedded in the binary automatically and the app crashes at startup as mentioned by @NumaNumaNuma. I have tried to manually embed the FB frameworks to the build but I honestly don't know which file from which project I should add to which target. All my attempts failed... Any clue on that? (and also, any clue in how to make it work using a post process script?) |
I've reverted to using an older version of the sdk for now (7.19.2 is the most recent one that doesn't use the 7.0 swift iOS sdk). |
I also reverted back to 7.19.2 as use_frameworks! Seems to have caused issues with other pods I’m using. |
@NumaNumaNuma yeah that seems to be the only option for now, it compiles and runs without problems! Thanks for sharing this! |
Current workaround here is to add "use_frameworks!" to Podfile or add an empty swift file to exported iOS project. The issue is fixed in 8fdb57a and will be shipped in the next release. |
@KylinChang And this is 6 days already from that commit, what happen? Why it still have error in travis and why it not released yet? |
@Thaina If you're in a rush maybe you could try and fixing it manually. If you look at the commit it's a very small change you could try to implement yourself. Add that blank swift file and the 2 build properties to your xcode project in a post-build script in unity. Sucks having to do it manually, but it might save you a few days (weeks?) while they release it. |
@NumaNumaNuma First, because that doesn't work So I don't actually know I do something wrong or the fix is not really work in the first place. Or it has some requirement that it should or must be a fix from facebook SDK package directly or any other reason Second, it not official so it pollute my code and need to actually remove it in the future when the real fix came out so I try to avoid that. And that's why I don't like to do that before confirm that facebook will not release it soon Third, it really didn't work, at least in unity 2020.2
In my case I need to move that #if UNITY_2019_3_OR_NEWER
string target = proj.GetUnityMainTargetGuid();
#else
string targetName = PBXProject.GetUnityTargetName();
string target = proj.TargetGuidByName(targetName);
#endif
////
#if UNITY_2019_3_OR_NEWER
foreach(var framework in new [] { target,proj.GetUnityFrameworkTargetGuid() })
#else
foreach(var framework in new [] { target })
#endif
{
proj.SetBuildProperty(framework, "ENABLE_BITCODE", "NO");
proj.SetBuildProperty(framework, "EMBEDDED_CONTENT_CONTAINS_SWIFT", "YES");
proj.SetBuildProperty(framework, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO");
proj.SetBuildProperty(framework, "SWIFT_VERSION", "5.0");
} |
Hi! Coud you please say when you are going to release fix? |
@KylinChang The fix is correct for older versions of Unity, but Unity 2019.3 and newer require a different target to be "fixed": I'll submit the fix in a PR soon. |
The issue is fixed in the latest release |
Checklist
Environment
Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
2018.4.23
7.21.0
Goals
I want to be able to update Facebook SDK without constant problem solving.
Expected Results
XCode would cleanly build the client after updating the SDK.
Actual Results
XCode fails to build
Steps to Reproduce
Update from 7.20.0 -> 7.21.0 and build on XCode
Code Samples & Details
Showing Recent Messages
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityDynamicReplacements
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility50
The text was updated successfully, but these errors were encountered: