我构建了一个离子应用程序并从中构建了iOS应用程序。当我尝试构建iOS应用程序时,我在此应用程序中使用了Firebase推送通知。我如何摆脱此处提到的重复文件
重复的符号_gtmnsdatazlibremainingbyteskey in: 销售CHING/PLAGINS/CORDOVA-PLUGIN-FIREBASE/googletoolboxformac.framework/googletoolboxformac(GTMNSDATA ZLIB_B66D12CF52CF52CF52CF52B1BAC6527D4B701A2E6F4.O) 重复的符号_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
架构的重复符号x86_64
这意味着您已经加载了两次相同的功能。由于该问题从其他链接器标志中删除-OBJC后消失,这意味着此选项会导致功能加载两次:
来自技术Q& a
此标志使链接器加载库中的每个对象文件 这定义了Objective-C类或类别。虽然这个选项将 通常会导致更大的可执行文件(由于其他对象代码 加载到应用程序中),将允许成功创建 有效的Objective-C静态库,其中包含类别 现有类。
https://developer.apple.com/library/content/qa/qa1490/_index.html
请点击此链接以获取更多详细信息
我也遇到了同样的问题。在我们的项目中,一些框架在我们的项目中添加了两次。因此,我通过从项目设置中删除重复的框架 ->构建阶段 ->与Binary链接二进制链接来修复它。然后,库检查一些框架可能会多次添加,只需找到重复的框架并将其删除,然后就可以正常工作。
这通常发生在多个库(对象文件)共享相同的变量/函数名称时,生成重复的符号。编译器对应该调用哪一个的编译器感到困惑。
要解决问题,我们可以制作函数 inline ,或者使用 macros 而不是函数名称。我们还可以通过使用 static 。