我现在也有同样的问题,但还没有找到正确的答案。我得到了错误:

    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o
    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)
duplicate symbol _OBJC_METACLASS_$_MoboSDK in:
    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o
    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)
ld: 75 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

任何帮助都是感激的。

最后,我找到了这个错误的原因,因为我添加了-ObjC到其他链接器标志。在删除这个值之后,我可以成功地构建我的项目,但我不知道为什么。有人能解释一下吗?


当前回答

上面的答案对我不起作用。下面是我解决这个问题的方法:

1)在finder中,删除整个Pods文件夹和Podfile。锁文件 2)关闭xcode项目 3)在终端运行pod install 4)打开xcode项目,运行clean build命令

在那之后为我工作。

其他回答

更新答案2021,Xcode 12。X:

pod deintegrate 
pod install

希望这能有所帮助!

今天,我得到了同样的错误。错误的关键字是duplicate。我通过:

1. Remove the duplicate file at Build Phases-->Compile Sources
2. If you can not remove it at Build Phases, you need find the file at your project and remove the reference by DELETE :

3. Add the file to your project again
4. Add the file's .m to your Build Phases-->Compile Sources again
5. Build your project, the error will disappear

架构x86_64的75个重复符号

意味着您已经加载了相同的函数两次。 当从其他链接标志中删除-ObjC后,问题消失了, 这意味着这个选项的结果是函数加载两次:

来自技术问答

这个标志使链接器加载库中的每个对象文件 它定义了一个Objective-C类或类别。而这个选项 通常会导致更大的可执行文件(由于额外的目标代码) 加载到应用程序中),它将允许成功创建 有效的包含类别的Objective-C静态库 现有的类。

https://developer.apple.com/library/content/qa/qa1490/_index.html

当我将lob项目集成到我的项目中时,同样的问题也发生在我身上。

实际上,lob项目也有AFNetworking文件, 所以我从lob项目中删除了。m文件。

实际上。m文件与我的项目POd/AFNetworking/ .m文件冲突

当你在不同的类中声明同名的const变量时也会发生:

Message.m文件

const int kMessageLength = 36;

@implementation Message

@end

在文件Chat.m

const int kMessageLength = 20;

@implementation Chat

@end