我们有一个静态库(libAudioBulb.a),我在这里几乎用于所有项目。静态库包含AFNetworking的源文件。在我的一个项目中,我也需要使用AFNetworking,但是,当我包含AFNetworking的源文件时,会出现构建时错误,表明我在项目和静态库中有重复的符号。但是,奇怪的是,在另一个项目中,我只是做了同样的事情,但没有构建时错误。那么,我需要在这里配置任何构建设置吗?
duplicate symbol _AFNetworkingTaskDidFinishErrorKey in:
/Users/jun/Library/Developer/Xcode/DerivedData/Enwave_Pro-blvydexcmotpqigieicimmkbrlnw/Build/Intermediates/Enwave Pro.build/Debug-iphoneos/Enwave Pro.build/Objects-normal/armv7/AFURLSessionManager.o
/Users/jun/Desktop/Projects/Multiroom/App/Enwave Pro/enwave_pro-ios/Enwave Pro/Sources/MultiroomPlay/libAudioBulb.a(AFURLSessionManager.o)
duplicate symbol _AFNetworkingTaskDidCompleteErrorKey in:
/Users/jun/Library/Developer/Xcode/DerivedData/Enwave_Pro-blvydexcmotpqigieicimmkbrlnw/Build/Intermediates/Enwave Pro.build/Debug-iphoneos/Enwave Pro.build/Objects-normal/armv7/AFURLSessionManager.o
/Users/jun/Desktop/Projects/Multiroom/App/Enwave Pro/enwave_pro-ios/Enwave Pro/Sources/MultiroomPlay/libAudioBulb.a(AFURLSessionManager.o)
duplicate symbol _AFNetworkingTaskDidFinishResponseSerializerKey in:
/Users/jun/Library/Developer/Xcode/DerivedData/Enwave_Pro-blvydexcmotpqigieicimmkbrlnw/Build/Intermediates/Enwave Pro.build/Debug-iphoneos/Enwave Pro.build/Objects-normal/armv7/AFURLSessionManager.o
/Users/jun/Desktop/Projects/Multiroom/App/Enwave Pro/enwave_pro-ios/Enwave Pro/Sources/MultiroomPlay/libAudioBulb.a(AFURLSessionManager.o)
duplicate symbol _AFNetworkingTaskDidCompleteResponseSerializerKey in:
/Users/jun/Library/Developer/Xcode/DerivedData/Enwave_Pro-blvydexcmotpqigieicimmkbrlnw/Build/Intermediates/Enwave Pro.build/Debug-iphoneos/Enwave Pro.build/Objects-normal/armv7/AFURLSessionManager.o
/Users/jun/Desktop/Projects/Multiroom/App/Enwave Pro/enwave_pro-ios/Enwave Pro/Sources/MultiroomPlay/libAudioBulb.a(AFURLSessionManager.o)
duplicate symbol _AFNetworkingTaskDidFinishAssetPathKey in:
/Users/jun/Library/Developer/Xcode/DerivedData/Enwave_Pro-blvydexcmotpqigieicimmkbrlnw/Build/Intermediates/Enwave Pro.build/Debug-iphoneos/Enwave Pro.build/Objects-normal/armv7/AFURLSessionManager.o
/Users/jun/Desktop/Projects/Multiroom/App/Enwave Pro/enwave_pro-ios/Enwave Pro/Sources/MultiroomPlay/libAudioBulb.a(AFURLSessionManager.o)
duplicate symbol _AFNetworkingTaskDidCompleteAssetPathKey in:
/Users/jun/Library/Developer/Xcode/DerivedData/Enwave_Pro-blvydexcmotpqigieicimmkbrlnw/Build/Intermediates/Enwave Pro.build/Debug-iphoneos/Enwave Pro.build/Objects-normal/armv7/AFURLSessionManager.o
/Users/jun/Desktop/Projects/Multiroom/App/Enwave Pro/enwave_pro-ios/Enwave Pro/Sources/MultiroomPlay/libAudioBulb.a(AFURLSessionManager.o)
答案 0 :(得分:0)
我找到了两种方法来解决这个问题:
如果在其他链接器标志下设置-ObjC,则会导致重复。如果不需要,请删除它。
如果无法执行选项1,则删除包含这些类的项目之一中冲突类的.m文件。