How to fix "linker command failed with exit code 1 (use -v to see invocation)" - objective-c

I was solving some conflict issues in Xcode, but when I run the application it returned these error messages:
duplicate symbol _OBJC_IVAR_$_MessagesViewController._users in:
/Users/BrenoMorais/Library/Developer/Xcode/DerivedData/SimplyCircle-fbtbskibjbfgzofjcvomrqorcxuq/Build/Intermediates/SimplyCircle.build/Debug-iphonesimulator/SimplyCircle.build/Objects-normal/i386/MessagesViewController-8AA2A9C32D34C91E.o
duplicate symbol _OBJC_CLASS_$_MessagesViewController in:
/Users/BrenoMorais/Library/Developer/Xcode/DerivedData/SimplyCircle-fbtbskibjbfgzofjcvomrqorcxuq/Build/Intermediates/SimplyCircle.build/Debug-iphonesimulator/SimplyCircle.build/Objects-normal/i386/MessagesViewController-8AA2A9C32D34C91E.o
duplicate symbol _OBJC_METACLASS_$_MessagesViewController in:
/Users/BrenoMorais/Library/Developer/Xcode/DerivedData/SimplyCircle-fbtbskibjbfgzofjcvomrqorcxuq/Build/Intermediates/SimplyCircle.build/Debug-iphonesimulator/SimplyCircle.build/Objects-normal/i386/MessagesViewController-8AA2A9C32D34C91E.o
ld: 3 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I already know I have a duplicate object, but I do not know how to fix it.
Already I tried to give rm -rf the files to delete them.

Try looking near _MessagesViewController._users
As you already now, you have duplicated objects.
Also, check this similar question: iOS - 3 duplicate symbols for architecture i386

Related

Duplicate symbols for architecture arm64 -objc

I added some .m, .h files(include xxxController.m, xxxController.h) and libraries(include abc.a) to my xcode project same as the sample project which runs very well but this error occured:
duplicate symbol 'OBJC_IVAR$xxxController.xxx' in:
/Users/xxx/Library/Developer/Xcode/DerivedData/xxx/Build/Intermediates.noindex/xxx.build/Debug-iphoneos/xxx.build/Objects-normal/arm64/xxxController.o
../lib/xxx/lib/abc.a(xxx.o) ld: 15 duplicate symbols for architecture
arm64 clang: error: linker command failed with exit code 1 (use -v to
see invocation)
I changed enable testability option and no common blocks option to NO but still fail to build.
Also there are no duplicates in the compile source and removing derived data or cleaning build folder didn't work for me.
And when I remove '-Objc' in Other Linker Flags, it occurs 'Undefined symbol: OBJC_CLASS$_FIRInstallations' error. How can I fix it?

Duplicate symbol

Could someone please help me understand what the duplicate symbol is ?
Regards
JZ
duplicate symbol _dragView in:
/Users/johnzofrea/Library/Developer/Xcode/DerivedData/I.C.E.-hhtrjcilahjtzdcnpruoskiftdrw/Build/Intermediates/I.C.E..build/Debug-iphonesimulator/I.C.E..build/Objects-normal/x86_64/ImageCropView.o
/Users/johnzofrea/Library/Developer/Xcode/DerivedData/I.C.E.-hhtrjcilahjtzdcnpruoskiftdrw/Build/Intermediates/I.C.E..build/Debug-iphonesimulator/I.C.E..build/Objects-normal/x86_64/HealthInsuranceInfo.o
ld: 1 duplicate symbol for architecture x86_64 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
Check in Build phases, that you aren't compiling twice the same file.
Search dragView in your project, you should see that you have twice a reference.

duplicate symbols for architecture x86_64 when import LWIMKIT.framwork

Project use swift. And after importing this LWIMKIT.framwork, I faced duplicate symbols problem.
duplicate symbol _OBJC_CLASS_$_DDTTYLoggerColorProfile in:
/Users/Arain/Library/Developer/Xcode/DerivedData/Taoji-aldpdybccvcoflbbrtplhgqzroqp/Build/Intermediates/Taoji.build/Debug-iphonesimulator/Taoji.build/Objects-normal/x86_64/DDTTYLogger.o
/Users/Arain/Desktop/ARAIN_PRO/develop/Taoji/LWIMKIT.framework/LWIMKIT(DDTTYLogger.o)
duplicate symbol _OBJC_METACLASS_$_DDTTYLoggerColorProfile in:
/Users/Arain/Library/Developer/Xcode/DerivedData/Taoji-aldpdybccvcoflbbrtplhgqzroqp/Build/Intermediates/Taoji.build/Debug-iphonesimulator/Taoji.build/Objects-normal/x86_64/DDTTYLogger.o
/Users/Arain/Desktop/ARAIN_PRO/develop/Taoji/LWIMKIT.framework/LWIMKIT(DDTTYLogger.o)
...
ld: 123 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I delete -ObjC in other linker flags, this can be solved, but when compiling, another problem shows which is unrecognized selector sent to class, I guess this framework define some variables or function whose name same as system.
Please help me!!!

How to resolve error: linker command failed with exit code 1 (use -v to see invocation) in Xcode5

duplicate symbol _flag in:
/Users/anuragarwt/Library/Developer/Xcode/DerivedData/FacesFactory1919-azxixfmcaofhiubsbjsjuvwyehhy/Build/Intermediates/FacesFactory1919.build/Debug-iphonesimulator/FacesFactory1919.build/Objects-normal/i386/LoginFacesFactoryViewController.o
/Users/anuragarwt/Library/Developer/Xcode/DerivedData/FacesFactory1919-azxixfmcaofhiubsbjsjuvwyehhy/Build/Intermediates/FacesFactory1919.build/Debug-iphonesimulator/FacesFactory1919.build/Objects-normal/i386/EditProfileFacesFactoryViewController.o ld: 1 duplicate symbol for architecture i386 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
Firstly, when we import .m file instead of .h file then the error of duplicate symbol occurs.
Secondly, i just changed the variable int flag to int i , v for different classes cleaned the project and run it worked.

3 duplicated symbols for architecture i386

After I try to build my app with Xcode, this error appear:
duplicate symbol _OBJC_IVAR_$_StoreVars._Traguardo in:
/Users/Fede/Library/Developer/Xcode/DerivedData/ProvaTapChallenge-bqumsaqmowwbdfbzgzrrwlblxsgh/Build/Intermediates/ProvaTapChallenge.build/Debug-iphonesimulator/ProvaTapChallenge.build/Objects-normal/i386/ViewController.o
/Users/Fede/Library/Developer/Xcode/DerivedData/ProvaTapChallenge-bqumsaqmowwbdfbzgzrrwlblxsgh/Build/Intermediates/ProvaTapChallenge.build/Debug-iphonesimulator/ProvaTapChallenge.build/Objects-normal/i386/ViewControllerBase.o
duplicate symbol _OBJC_METACLASS_$_StoreVars in:
/Users/Fede/Library/Developer/Xcode/DerivedData/ProvaTapChallenge-bqumsaqmowwbdfbzgzrrwlblxsgh/Build/Intermediates/ProvaTapChallenge.build/Debug-iphonesimulator/ProvaTapChallenge.build/Objects-normal/i386/ViewController.o
/Users/Fede/Library/Developer/Xcode/DerivedData/ProvaTapChallenge-bqumsaqmowwbdfbzgzrrwlblxsgh/Build/Intermediates/ProvaTapChallenge.build/Debug-iphonesimulator/ProvaTapChallenge.build/Objects-normal/i386/ViewControllerBase.o
duplicate symbol _OBJC_CLASS_$_StoreVars in:
/Users/Fede/Library/Developer/Xcode/DerivedData/ProvaTapChallenge-bqumsaqmowwbdfbzgzrrwlblxsgh/Build/Intermediates/ProvaTapChallenge.build/Debug-iphonesimulator/ProvaTapChallenge.build/Objects-normal/i386/ViewController.o
/Users/Fede/Library/Developer/Xcode/DerivedData/ProvaTapChallenge-bqumsaqmowwbdfbzgzrrwlblxsgh/Build/Intermediates/ProvaTapChallenge.build/Debug-iphonesimulator/ProvaTapChallenge.build/Objects-normal/i386/ViewControllerBase.o
ld: 3 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
how can i solve this? help me, please!
This can happen if you've accidentally imported StoreVars.m file instead of StoreVars.h