Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linker Error in iOS (duplicate symbols for architecture x86_64)

Tags:

I keep on getting the following error:

duplicate symbol _llvm.embedded.module in: /Users/name/Documents/FacebookSDKs-iOS-20150910/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKApplicationDelegate.o) /Users/name/Documents/FacebookSDKs-iOS-20150910/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKServerConfiguration.o) ld: 102 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

I've tried deleting the FBSDK and reinstalling, but that has not work. I also suspect that the fact that I'm bridging the framework into Swift may be the problem. My bridging header contains the following:

#ifndef EggCrush_Bridge_h #define EggCrush_Bridge_h  #import <FBSDKCoreKit/FBSDKCoreKit.h>  #endif 

My AppDelegate.swift file imports FBSDKCoreKit.
There are no other linker flags.
I'm running Xcode 6.3.2 and building a project for iOS 8.3

How to clear this error up?

like image 227
Dan Avatar asked Sep 11 '15 03:09

Dan


People also ask

What does 1 duplicate symbol for architecture x86_64 mean?

duplicate symbol _OBJC_IVAR_$_BLoginViewController._hud in: 17 duplicate symbols for architecture x86_64. "Means that you have loaded same functions twice. As the issue disappear after removing -ObjC from Other Linker Flags, this means that this option result that functions loads twice:"

What is undefined symbols for architecture x86_64?

Why Is the Undefined Symbols for Architecture x86_64: Error Happening? This error is happening due to the lack of included values inside the declared statements in your code. The browser is going to render the information incorrectly and show this error, especially if you are working with Main and Similarity tools.


2 Answers

If not mistaken, you are using the sdk which just released by Facebook at September 10th, 2015 which named as FacebookSDKs-iOS-20150910.zip. Try to use sdk that released at August 13th, 2015 which named as FacebookSDKs-iOS-20150813.zip and report to Facebook about the duplication problem if you can. Thank you.

like image 186
Guan Chuan Avatar answered Sep 28 '22 04:09

Guan Chuan


This thread explains you must compile the Facebook 4.6.0 SDK in Xcode 7 to resolve the issue. After compiling in Xcode 7 it worked for me.

In the Facebook iOS SDK 4.6.0, App Thinning (Bitcode) support has been added and therefore it cannot be complied in Xcode versions lower than Xcode 7.0.

like image 33
Aravind Mariappan Avatar answered Sep 28 '22 03:09

Aravind Mariappan