Error: duplicate symbols for architecture armv7 after change Core Data Model

百般思念 提交于 2019-12-10 14:24:51

问题


I have an app using core data framework. I was working fine. I just changed the data model - add an attribute to one entity. And when I try to build it, I got an error:

duplicate symbol _OBJC_METACLASS_$_AccountFolder in:
/Users/XXX/Library/Developer/Xcode/DerivedData/MyApp-bxsswgxdenxgjweotkkkckaoalat/Build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/AccountFolder-33D7EA63E98D6090.o

ld: 4 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I did some search, and most people getting this error is from mistyping .h to .m, or import same .h several times. I checked my code. I don't have that. And the coredata framework is still there.

Does anyone know what else can be the reason? Thanks.


回答1:


Check if there are multiple NSManagedObject subclass files generated after making this change. There should be duplicate files generated after your attribute change. Check in finder window as well as in project and then remove the duplicate files. That should fix this issue.



来源:https://stackoverflow.com/questions/14448920/error-duplicate-symbols-for-architecture-armv7-after-change-core-data-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!