K.K.D
K.K.D

Reputation: 937

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?

Upvotes: 14

Views: 2755

Answers (3)

Gibraltar
Gibraltar

Reputation: 1115

I solved the issue by

  1. Deleting everything from my podfile and running pod install
  2. Putting everything back in my podfile and running pod install

It's the only thing that worked for me.

Upvotes: 0

Paul Beusterien
Paul Beusterien

Reputation: 29572

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'

Upvotes: 2

Radu Carlig
Radu Carlig

Reputation: 223

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

Upvotes: 4

Related Questions