Duplicate symbols for architecture arm64 -objc - objective-c

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?

Related

Same library included from two libraries

I get error:
ld: 24 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
because I have two libraries that both use GTMLogger.o.
/Users/***/Library/Developer/Xcode/DerivedData/project-name/Build/Products/Debug-iphoneos/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
/Users/***/project-name/Libraries/Framework/Framework.framework/Framework(GTMLogger.o)
One library is included as cocoapod and the other is included manually. Second library cant be included as cocoapod.
I need both libraries and just want to know is there a way to solve this?

iOS 9 specific linker error with respect to WebKit.framework

I am receiving the following linker error on iOS 9 and above. I am stuck with this issue for quite sometime. Any help would be appreciable.
ld: file not found: /System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have fixed this issue my removing WebKit.framework from the project's file system and again adding it only thru Build phases.

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!!!

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

iOS Linker Command Failed using Core Plot Xcode 4.3.2

So I'm building an application with CorePlot, and when I tried to run it i got the following errors:
ld: warning: ignoring file /Users/tcbl/Library/Developer/Xcode/DerivedData/FaceTracker- chbhtqlxwipamtailjamrakmkpuy/Build/Products/Debug-iphoneos/libCorePlot-CocoaTouch.a,
file was built for archive which is not the architecture being linked (armv6)
ld: duplicate symbol _main in /Users/tcbl/Library/Developer/Xcode/DerivedData/FaceTracker-chbhtqlxwipamtailjamrakmkpuy/Build/Intermediates/FaceTracker.build/Debug-iphoneos/FaceTracker.build/Objects-normal/armv6/main-cocoatouch.o and /Users/tcbl/Library/Developer/Xcode/DerivedData/FaceTracker-chbhtqlxwipamtailjamrakmkpuy/Build/Intermediates/FaceTracker.build/Debug-iphoneos/FaceTracker.build/Objects-normal/armv6/main.o for architecture armv6
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I read somewhere that I need to add to other linker flags: -ObjC -all_load -lCorePlot But this doesn't seem to be anywhere in the project info or build settings, and I'm not sure if this even has anything to do with my error. Any help demystifying this would be much appreciated.
If you select your project and go to the Build Settings tab, you should find it listed under Linking. Make sure you have the advanced/complete view of the tab. The field you want to enter those under is "Other Linker Flags".
Hope that helps!