Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve "duplicate symbol" when added Firebase in Xcode

I can't solve the error "duplicate symbol".

The error is

duplicate symbol _GSDK_NSClassFromString in: .../Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore(overload_9ea29fd47bf44ee000bc4282b65dac06.o)
 /Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o)

duplicate symbol _GSDK_objc_getClass in: .../Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore(overload_9ea29fd47bf44ee000bc4282b65dac06.o)
/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o)

duplicate symbol _GSDK_objc_getProtocol in:    ...Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore(overload_9ea29fd47bf44ee000bc4282b65dac06.o)
    .../Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o)

duplicate symbol _GSDK_objc_lookUpClass in:        ...Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore(overload_9ea29fd47bf44ee000bc4282b65dac06.o)
    ...Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities(overload.o)

ld: 4 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I updated and installed Podfile. But it didn't work.

Pod file

target 'game' do

  # Pods for game
  pod 'Firebase'
  pod 'Firebase/AdMob'
end

I could add Firebase before. But when I accidentally delete "FirebaseCore.framework". After that I deleted Pods and reinstalled Firebase, but it didn't work.

How can I solve it?

like image 476
K.K.D Avatar asked Jan 26 '17 10:01

K.K.D


2 Answers

I had the same issue. It seems that the -all_load flag in the Other Linker Flags is causing this.

like image 133
Radu Carlig Avatar answered Sep 28 '22 02:09

Radu Carlig


There was a Firebase build issue introduced in 3.11.1 that will be fixed in 3.13.0 that can cause the duplicate symbol problem. In the meantime, a workaround is to back up to Firebase 3.11.0, by annotating any Firebase subspecs in your podfile with an explicit version number, like :

pod 'Firebase/Analytics', '3.11.0'
like image 36
Paul Beusterien Avatar answered Sep 28 '22 01:09

Paul Beusterien