过去几天我一直在处理这个错误,我真的被卡住了。我一直收到链接器命令错误,无法通过它。我搜索了网页并尝试了所有提示:检查重复文件,重新安装的pods,将活动架构设置为NO,删除派生数据,清理很多次。
这是我给出的输出:
duplicate symbol _OBJC_IVAR_$_SessionPlayer._nextEvent in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_IVAR_$_SessionPlayer._visitors in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_IVAR_$_SessionPlayer._currentSessionTimeInMilliseconds in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_IVAR_$_SessionPlayer._systemTimeInMilliseconds in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_CLASS_$_SessionPlayer in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_METACLASS_$_SessionPlayer in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_IVAR_$_SessionPlayer._isPlaying in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_IVAR_$_SessionPlayer._useTiming in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_IVAR_$_SessionPlayer._delegate in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
duplicate symbol _OBJC_IVAR_$_SessionPlayer._timeline in:
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayer.o
/Users/user1/Library/Developer/Xcode/DerivedData/***-APP-NAME-bahimtombyapwkcekphmmbaifpqx/Build/Intermediates/***-APP-NAME.build/Debug-iphonesimulator/***-APP-NAME.build/Objects-normal/x86_64/SessionPlayerViewController.o
ld: 10 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
真的不知道该怎么做,这非常令人沮丧。
编辑:发现我的所有文件都被编译了两次,这可能就是问题所在。
答案 0 :(得分:3)
听起来你已经在你的目标构建中包含了SessionPlayer.m
两次的来源。根据一些评论,可能是因为您通过pod(这是您想要的)隐式引用文件,并通过直接引用显式 / included(你不想想要的;那是pod的用途)。尝试执行以下操作(我会尽量在文本中尽可能清楚,但如果您有任何问题我可以包含屏幕截图):
SessionPlayer.m
,因此您应该在列表中看到至少一个实例。选择" - "删除它显示在列表底部的按钮。SessionPlayer.m
相关的链接器错误是否消失。如果是,请对任何其他此类文件重复上述步骤。希望这有帮助。