在没有Cocoapods的情况下手动集成Firebase和Google Sign In SDK时重复的符号

在我现有的iOS项目中手动集成Firebase和Google Sign In SDK时,出现重复符号错误。

这里的相关SO问题没有帮助,因为它使用Cocoapods。

Firebase和Google Signin给出了重复的符号错误

我按时间顺序采取的步骤:

  1. 从下载的Firebase SDK(3.11.0)复制Analytics,Auth和Database文件夹以及Firebase.h文件到我的项目中并添加到目标中。

  2. 将GoogleService-Info.plist复制到项目中并添加到目标。

  3. 向其他链接器标志添加了-ObjC标志。

  4. 将下载的Google Sign In SDK(4.0.1)中的必要框架和软件包复制到我的项目中,并添加到目标中。

  5. 链接必要的框架和库。

这里是相关的项目结构:

Firebase Analytics FirebaseAnalytics.framework FirebaseCore.framework FirebaseInstanceId.framework GoogleInterchangeUtilities.framework GoogleSymbolUtilities.framework GoogleToolboxForMac.framework Auth FirebaseAuth.framework GTMSessionFetcher.framework GoogleSignIn GoogleAppUtilities.framework GoogleSignIn.bundle GoogleSignIn.framework GoogleSignInDependencies.framework GoogleSymbolUtilities.framework (removed as Firebase Analytics already includes it) 

这里是错误日志(截断):

 Ld /Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Products/Debug-iphonesimulator/AddressBookGoogleMaps.app/AddressBookGoogleMaps normal x86_64 cd /Projects/iOS/AddressBookGoogleMaps export IPHONEOS_DEPLOYMENT_TARGET=8.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Products/Debug-iphonesimulator -F/Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Products/Debug-iphonesimulator -F/Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics -F/Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth -F/Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Database -F/Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn -filelist /Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Intermediates/AddressBookGoogleMaps.build/Debug-iphonesimulator/AddressBookGoogleMaps.build/Objects-normal/x86_64/AddressBookGoogleMaps.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Intermediates/AddressBookGoogleMaps.build/Debug-iphonesimulator/AddressBookGoogleMaps.build/Objects-normal/x86_64/AddressBookGoogleMaps_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Intermediates/AddressBookGoogleMaps.build/Debug-iphonesimulator/AddressBookGoogleMaps.build/AddressBookGoogleMaps.app.xcent -framework GoogleToolboxForMac -framework FirebaseAuth -framework FirebaseAnalytics -framework GoogleSignInDependencies -framework SystemConfiguration -framework GoogleAppUtilities -framework GTMSessionFetcher -framework FirebaseCore -framework GoogleSignIn -framework SafariServices -framework GoogleSymbolUtilities -framework Accelerate -framework GoogleSymbolUtilities -framework GoogleInterchangeUtilities -framework FirebaseDatabase -framework FirebaseInstanceID -Xlinker -dependency_info -Xlinker /Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Intermediates/AddressBookGoogleMaps.build/Debug-iphonesimulator/AddressBookGoogleMaps.build/Objects-normal/x86_64/AddressBookGoogleMaps_dependency_info.dat -o /Users/Ehtesham/Library/Developer/Xcode/DerivedData/AddressBookGoogleMaps-hbtfxxvykazaogbfqnnraeuywtdt/Build/Products/Debug-iphonesimulator/AddressBookGoogleMaps.app/AddressBookGoogleMaps duplicate symbol _OBJC_CLASS_$_GTMLogStandardFormatter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_METACLASS_$_GTMLogStandardFormatter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_CLASS_$_GTMLogBasicFormatter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_METACLASS_$_GTMLogBasicFormatter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_CLASS_$_GTMLogNoFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_METACLASS_$_GTMLogNoFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_CLASS_$_GTMLogMininumLevelFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_METACLASS_$_GTMLogMininumLevelFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_CLASS_$_GTMLogMaximumLevelFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_METACLASS_$_GTMLogMaximumLevelFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_CLASS_$_GTMLogLevelFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_METACLASS_$_GTMLogLevelFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) duplicate symbol _OBJC_CLASS_$_GTMLogAllowedLevelFilter in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMLogger_e66760ac68814bab22c3e6b0850da5e6.o) ........................................ ........................................ duplicate symbol _OBJC_IVAR_$_GTMSessionFetcherService._cookieStorageMethod in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionFetcherService_c6b7326897506dd1305d6961fdc1ec8b.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionFetcherService_c6b7326897506dd1305d6961fdc1ec8b.o) duplicate symbol _OBJC_IVAR_$_GTMSessionFetcherService._retryEnabled in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionFetcherService_c6b7326897506dd1305d6961fdc1ec8b.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionFetcherService_c6b7326897506dd1305d6961fdc1ec8b.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadGranularity in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._shouldInitiateOffsetQuery in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._lastChunkRequest in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._initialBodySent in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._fetcherInFlight in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._currentOffset in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._useBackgroundSessionOnChunkFetchers in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._recentChunkReponseHeaders in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._delegateCompletionHandler in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._chunkFetcher in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_CLASS_$_GTMSessionUploadFetcher in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_METACLASS_$_GTMSessionUploadFetcher in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadDataProvider in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _kGTMSessionFetcherUploadLocationObtainedNotification in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._initialBodyLength in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadFileLength in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._subdataGenerating in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._isSubdataGenerating in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _kGTMSessionUploadFetcherMaximumDemandBufferSize in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._chunkSize in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _kGTMSessionUploadFetcherStandardChunkSize in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._delegateCallbackQueue in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadMIMEType in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadFileHandle in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._recentChunkStatusCode in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._isPaused in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._isRestartedUpload in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadData in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadLocationURL in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) duplicate symbol _OBJC_IVAR_$_GTMSessionUploadFetcher._uploadFileURL in: /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/GoogleSignIn/GoogleSignInDependencies.framework/GoogleSignInDependencies(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) /Projects/iOS/AddressBookGoogleMaps/AddressBookGoogleMaps/Sources/Externals/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher(GTMSessionUploadFetcher_fb894b20da0d1114d3ddd8f56ed741c5.o) ld: 194 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

虽然离理想的解决scheme还很远,但我仍然是这样解决的。

(这个解决scheme可以应用于两个静态库导致“重复符号”错误的任何情况,因为这两个库都包含公共类并使用-all_load-all_load标志。)

将GoogleSignInDependencies.framework内的GoogleSignInDependencies文件复制到单独的位置PATH中。 这个文件是一个胖文件,这意味着它有不同的体系结构代码。

打开terminal并转到PATH。

 $ cd PATH 

运行以下命令获取有关胖库的信息。

 $ lipo -info GoogleSignInDependencies 

你会得到以下结果。

 Architectures in the fat file: GoogleSignInDependencies are: armv7 i386 x86_64 arm64 

正如你所看到的,fat文件中有4个体系结构。

通过运行以下命令从胖文件获取精简文件(仅包含一个体系结构代码的文件)。

 $ lipo -thin armv7 GoogleSignInDependencies -output armv7.a $ lipo -thin i386 GoogleSignInDependencies -output i386.a $ lipo -thin x86_64 GoogleSignInDependencies -output x86_64.a $ lipo -thin arm64 GoogleSignInDependencies -output arm64.a 

您将得到4个名为armv7.a,i386.a,x86_64.a和arm64.a的瘦文件。

删除GoogleSignInDependencies文件,我们不再需要它了。

创build4个名为armv7,i386,x86_64和arm64的新文件夹。 然后将瘦文件armv7.a,i386.a,x86_64.a和arm64.a移动到相应的文件夹中。 你应该有如下的文件夹结构。

 arm64 arm64.a armv7 armv7.a i386 i386.a x86_64 x86_64.a 

从terminal转到4个文件夹中的每一个,使用以下命令从精简文件中提取目标文件(* .o)。

 $ cd armv7 $ ar -x armv7.a $ cd ../i386 $ ar -x i386.a $ cd ../x86_64 $ ar -x x86_64.a $ cd ../arm64 $ ar -x arm64.a 

运行这些命令后,4个文件夹中的每一个都应包含以下文件。 (这可以在将来的版本中改变。)

 __.SYMDEF GTMGeometryUtils_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMLogger_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMNSDictionary+URLArguments_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMNSString+URLArguments_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMOAuth2Authentication_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMOAuth2SignIn_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMOAuth2ViewControllerTouch_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionFetcher_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionFetcherLogging_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionFetcherService_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionUploadFetcher_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSynchronizationAsserts_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o 

从4个文件夹中删除与Firebase库冲突的文件。 您需要删除这6个文件。 (这可以在将来的版本中改变。)

 GTMLogger_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMNSDictionary+URLArguments_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionFetcher_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionFetcherLogging_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionFetcherService_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o GTMSessionUploadFetcher_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.o 

删除瘦文件armv7.a,i386.a,x86_64.a和arm64.a。

通过运行以下命令将剩余的目标文件合并到精简文件中。

 $ cd armv7 $ libtool -static *.o -o armv7-new.a $ cd ../i386 $ libtool -static *.o -o i386-new.a $ cd ../x86_64 $ libtool -static *.o -o x86_64-new.a $ cd ../arm64 $ libtool -static *.o -o arm64-new.a 

将新创build的瘦文件armv7-new.a,i386-new.a,x86_64-new.a和arm64-new.a复制到新的位置PATH_NEW。 你可以删除PATH里面的所有内容。

通过运行以下命令将新的瘦文件合并到一个新的胖文件中。

 $ cd PATH_NEW $ lipo -create armv7-new.a i386-new.a x86_64-new.a arm64-new.a -output GoogleSignInDependencies-new 

在您的Xcode项目中使用新生成的GoogleSignInDependencies-new代替GoogleSignInDependencies。

我强烈build议下面的文章,以深入了解的事情。

http://atnan.com/blog/2012/01/12/avoiding-duplicate-symbol-errors-during-linking-by-removing-classes-from-static-libraries

如果你有这个问题,我刚刚写了一个bash shell脚本,它为我做了所有的工作。 我已经把它保存为一个主旨 。 需要您自担风险使用它。

真正的问题是, 你为什么直接复制而不是使用cocoapods? 使用你的方法确实没有什么好处。 如果你使用cocoapods你不会有这个问题。 如果我是你,我会删除这些文件,并与cocoapods安装。 当你安装cocoapods时,错误的可能性要小得多