Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 870
user1491987 Avatar asked Jan 21 '13 23:01

user1491987


1 Answers

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.

like image 61
iDev Avatar answered Oct 23 '22 02:10

iDev