由于GoogleAnalytics库出现重复的符号错误,因此在链接期间无法在Xcode 10 beta 5上构建包含GoogleAnalytics库的项目。
这不是CocoaPods的问题,手动集成GoogleAnalytics也会失败,并出现相同的错误。其他二进制分布式库(CardIO,Crashlytics,Fabric)也发生相同的问题。根据Apple的链接器工程师的说法,这不是错误,而是Xcode 10 beta 5中修复的错误。此修复程序无法与使用10b5之前的较旧Xcode构建的损坏的静态库互操作,并且尽可能提供最佳解决方案是用较新版本的Xcode编译这些库(我在CardIO上也遇到了同样的问题,仅通过用Xcode 10b5重新编译就可以成功修复它)。
由于GoogleAnalytics是封闭源代码,因此我无法对其进行任何处理。任何GoogleAnalytics维护者都可以使用最新的Xcode对其进行重新编译并发布新版本吗?
https://forums.developer.apple.com/thread/106694 https://github.com/CocoaPods/CocoaPods/issues/7965 https://twitter.com/crashlytics/status/1024359450436685824 https://twitter.com/steipete/status/1024905104191901698
错误日志:
Ld /Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Products/Debug-iphoneos/DuplicateSymbolError.app/DuplicateSymbolError normal arm64 (in target: DuplicateSymbolError)
cd /Users/redacted/DuplicateSymbolError
export IPHONEOS_DEPLOYMENT_TARGET=12.0
/Applications/Xcode-10.beta.5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode-10.beta.5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk -L/Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Products/Debug-iphoneos -L/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries -F/Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Products/Debug-iphoneos -filelist /Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Intermediates.noindex/DuplicateSymbolError.build/Debug-iphoneos/DuplicateSymbolError.build/Objects-normal/arm64/DuplicateSymbolError.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=12.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Intermediates.noindex/DuplicateSymbolError.build/Debug-iphoneos/DuplicateSymbolError.build/Objects-normal/arm64/DuplicateSymbolError_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-link-runtime -L/Applications/Xcode-10.beta.5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Intermediates.noindex/DuplicateSymbolError.build/Debug-iphoneos/DuplicateSymbolError.build/Objects-normal/arm64/DuplicateSymbolError.swiftmodule -ObjC -lGoogleAnalytics -lsqlite3 -lz -framework CoreData -framework SystemConfiguration -lc++ -weak_framework CoreMedia -weak_framework AudioToolbox -weak_framework Accelerate -weak_framework AVFoundation -weak_framework MobileCoreServices -lPods-DuplicateSymbolError -Xlinker -dependency_info -Xlinker /Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Intermediates.noindex/DuplicateSymbolError.build/Debug-iphoneos/DuplicateSymbolError.build/Objects-normal/arm64/DuplicateSymbolError_dependency_info.dat -o /Users/redacted/Library/Developer/Xcode/DerivedData/DuplicateSymbolError-hdngfzrxvqtekrbpcrcqnsfnwsys/Build/Products/Debug-iphoneos/DuplicateSymbolError.app/DuplicateSymbolError
duplicate symbol l022 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIUtil.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIError.o)
duplicate symbol l023 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIUtil.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIError.o)
duplicate symbol l024 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIUtil.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIError.o)
duplicate symbol l066 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAICoreDataUtil.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIHitUtil.o)
duplicate symbol l071 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIHitUtil.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIStringUtil.o)
duplicate symbol l160 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerImpl.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
duplicate symbol l161 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerImpl.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
duplicate symbol l162 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerImpl.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
duplicate symbol l163 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerImpl.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
duplicate symbol l036 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackedViewController.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIEcommercePromotion.o)
duplicate symbol l037 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackedViewController.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIEcommercePromotion.o)
duplicate symbol l038 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIExceptionParser.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIEcommercePromotion.o)
duplicate symbol l039 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIExceptionParser.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIEcommercePromotion.o)
duplicate symbol l129 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIDictionaryBuilder.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIUsageTracker.o)
duplicate symbol l130 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIDictionaryBuilder.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAIUsageTracker.o)
duplicate symbol l151 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l152 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l153 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l154 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l155 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l156 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l157 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l158 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
duplicate symbol l159 in:
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAITrackerModel.o)
/Users/redacted/DuplicateSymbolError/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a(GAISqlStore.o)
ld: 24 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
答案 0 :(得分:0)
我自己也遇到过同样的问题。 Xcode 10 beta 6(几天前发布)解决了该问题。