Facebook-sdk-for-unity: v7.16 iOS Build Failure due to duplicate symbols in FBSDKCoreKit.framework

Created on 19 Jun 2019  路  2Comments  路  Source: facebook/facebook-sdk-for-unity

When build exported XCode 10.2.1 project from Unity 2018.2, there is many similar build errors like: duplicate symbol _OBJC_CLASS_$_FBSDKGraphRequestPiggybackManager in: /Assets/../ExportProjects/IOS/Frameworks/FacebookSDK/Plugins/iOS/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKGraphRequestPiggybackManager.o) /ExportProjects/IOS/Frameworks/FacebookSDK/Plugins/iOS/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKGraphRequestPiggybackManager.o)

I found that if I remove "-force_load" and the following FBSDKCoreKit path under Other Linker Flags, it could build with no problems.

v7.15 has no such issue.

related issue #208

Most helpful comment

I found too, but in my project, the 7.16.0 is ok, the error occurred in 7.16.1.
It's caused by the modify of FixupFiles.cs, It's change from:
7.16.0:
string corekitPath = Path.Combine(path, "Frameworks/FacebookSDK/Plugins/iOS/FBSDKCoreKit.framework/FBSDKCoreKit");
proj.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-force_load " + corekitPath);

to :
7.16.1:
proj.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-all_load");

This will make all my ".a" files linked into the binary file, and if two different lib file point to same target, it's will be error!

All 2 comments

I found too, but in my project, the 7.16.0 is ok, the error occurred in 7.16.1.
It's caused by the modify of FixupFiles.cs, It's change from:
7.16.0:
string corekitPath = Path.Combine(path, "Frameworks/FacebookSDK/Plugins/iOS/FBSDKCoreKit.framework/FBSDKCoreKit");
proj.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-force_load " + corekitPath);

to :
7.16.1:
proj.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-all_load");

This will make all my ".a" files linked into the binary file, and if two different lib file point to same target, it's will be error!

Hi @keysguy , you can use -force_load flag in your xcode project instead if you find there is an error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edscodeblenders picture edscodeblenders  路  4Comments

pvalium picture pvalium  路  6Comments

derwaldgeist picture derwaldgeist  路  4Comments

manofspirit picture manofspirit  路  6Comments

michelleran picture michelleran  路  6Comments