UIB
UIB

Reputation: 113

duplicate symbols for architecture x86_64 error when building IOS application in ionic

I built an ionic app and built the IOS app from it. I used firebase push notifications in this applications when I tried to build the IOS application keeps getting this error. How can I get rid of the duplicate files mentioned in here

duplicate symbol _GTMNSDataZlibRemainingBytesKey in: /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMNSData+zlib.o) Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMNSData+zlib_b66d12cf522b1bac6527d4b701a2e6f4.o) duplicate symbol _GTMNSDataZlibErrorKey in:

    /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMNSData+zlib.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMNSData+zlib_b66d12cf522b1bac6527d4b701a2e6f4.o)
    duplicate symbol _GTMNSDataZlibErrorDomain in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMNSData+zlib.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMNSData+zlib_b66d12cf522b1bac6527d4b701a2e6f4.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogStandardFormatter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogStandardFormatter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogBasicFormatter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogBasicFormatter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogNoFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogNoFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogMininumLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogMininumLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogMaximumLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogMaximumLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogAllowedLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogAllowedLevelFilter in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_CLASS_$_GTMLogger in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_METACLASS_$_GTMLogger in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogLevelFilter.userDefaults_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogAllowedLevelFilter.allowedLevels_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogger.formatter_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogStandardFormatter.dateFormatter_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogger.filter_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogger.writer_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogStandardFormatter.pname_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogStandardFormatter.pid_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GTMLogLevelFilter.verboseLoggingEnabled_ in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
        Sale Ching/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_1d87861920ce748f18c427633f13fd22.o)
    duplicate symbol _OBJC_IVAR_$_GPBFloatArray._capacity in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/Protobuf/libProtobuf.a(GPBArray.o)
        Sale Ching/Plugins/cordova-plugin-firebase/Protobuf.framework/Protobuf(GPBArray_9c18dd0099bac64399d692ec28726322.o)
    duplicate symbol _OBJC_IVAR_$_GPBEnumArray._capacity in:
        /Users/uvinduchandrasiri/Library/Developer/Xcode/DerivedData/Sale_Ching-fmystclqwodflqflbkuaoyjyhfbc/Build/Products/Debug-iphonesimulator/Protobuf/libProtobuf.a(GPBArray.o)
duplicate symbols for architecture x86_64

Upvotes: 4

Views: 7659

Answers (3)

Nikita Jain
Nikita Jain

Reputation: 759

This usually happens when multiple libraries (object files) are sharing the same variable/function name, generating duplicate symbols. The compiler gets confused about which one should be invoked.

To solve the issue, we can either make functions inline or use macros instead of the function name. We can also make function scope local to the library only by using static.

Upvotes: 0

Bharat Bhushan
Bharat Bhushan

Reputation: 419

I had also faced the same problem.Somehow some frameworks got added twice in our project.So I fixed it by removing the duplicate frameworks from project settings -> build phases -> link Binary with libraries then check some frameworks may be added multiple times, just find the repeated frameworks and remove them, then it should work fine.

Upvotes: 0

Karthik Kumar
Karthik Kumar

Reputation: 1385

duplicate symbols for architecture x86_64

This means that you have loaded same functions twice. As the issue disappears after removing -ObjC from Other Linker Flags, this means that this option result that functions loads twice:

from Technical Q&A

This flag causes the linker to load every object file in the library that defines an Objective-C class or category. While this option will typically result in a larger executable (due to additional object code loaded into the application), it will allow the successful creation of effective Objective-C static libraries that contain categories on existing classes.

https://developer.apple.com/library/content/qa/qa1490/_index.html

Please follow this link for further details

Upvotes: 3

Related Questions