How to solve “duplicate symbol” when added Firebase in Xcode

I can’t solve the error “duplicate symbol”.

The error is

  • How to design a simple GLSL wrapper for shader use
  • Getting signatures of private API methods for iOS
  • iOS - Concurrency performing 5 operations uploading images to server using NSOperationQueue followed by single Task in Objective-c
  • Seeing black bars at the top and bottom of the iPhone X Simulator
  • How to go to second view controller after click on disclosure indicator button
  • Modify UIImage renderingMode from a storyboard/xib file
  • 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?

    2 Solutions Collect From Internet About “How to solve “duplicate symbol” when added Firebase in Xcode”

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

    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'