My app was working fine but after some modification I am getting following error please help me ......
duplicate symbol _OBJC_IVAR_$_MBThirdViewController.nameLabel1 in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu- bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug- iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController- D5D149C1AA17C975.o
duplicate symbol _OBJC_IVAR_$_MBThirdViewController.phoneLabel1 in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu-bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug- iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController-D5D149C1AA17C975.o
duplicate symbol _OBJC_IVAR_$_MBThirdViewController.emailLabel1 in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu-bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug-iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController-D5D149C1AA17C975.o
duplicate symbol _OBJC_IVAR_$_MBThirdViewController.photoView1 in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu- bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug- iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController- D5D149C1AA17C975.o
duplicate symbol _OBJC_IVAR_$_MBThirdViewController.imageVC in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu- bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug- iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController- D5D149C1AA17C975.o
duplicate symbol _OBJC_IVAR_$_MBThirdViewController.dataObject in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu-bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug-iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController-D5D149C1AA17C975.o
duplicate symbol _OBJC_CLASS_$_MBThirdViewController in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu-bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug- iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController- D5D149C1AA17C975.o
duplicate symbol _OBJC_METACLASS_$_MBThirdViewController in:
/Users/major/Library/Developer/Xcode/DerivedData/sideMenu- bslwsbjqbjtkojeslptbkyhajajv/Build/Intermediates/sideMenu.build/Debug- iphonesimulator/sideMenu.build/Objects-normal/i386/MBThirdViewController- D5D149C1AA17C975.o
ld: 8 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Go to Build Setting and search for No Common Blocks and set it NO. And build again you will not get this error again.
Make sure that the ViewController is not added twice in your project.
OR
you have declared same variable more than once.
Also got to Xcode->Window->Organizer->Projects
And Delete derived data
Hope that might help.
check if this MBThirdViewController is added twice in your project.
OR
remove the reference to it and try adding it again to your project.
Related
Im trying to update the Google Cast SDK from version 4.3.0 to 4.4.4 this due to the fact that the new version contains some fixes for iOS 13.
Since the update I get these build errors. It seems that both React and the cast SDK are using the same symbol and that's why is returns an error.
I'm trying to understand how to fix this error. I am unable to delete one of these libraries because I need them both and I'm also unable to change the code since they are both third party libraries.
I found this issue tracker and it seems to be a common error starting SDK 4.3.1. It seems to be fixed when using the dynamic framework for the Google Cast SDK but it's not the best situation because it's not available on CocoaPods.
Anyone who experienced a simular problem?
Error:
duplicate symbol 'fLB::FLAGS_nosymbolize_stacktrace' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(examine_stack_7d30b36ef2bc773365435990abbc0852.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(utilities.o)
duplicate symbol 'fLB::FLAGS_symbolize_stacktrace' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(examine_stack_7d30b36ef2bc773365435990abbc0852.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(utilities.o)
duplicate symbol 'fLB::FLAGS_nolog_prefix' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLB::FLAGS_log_prefix' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLB::FLAGS_noalsologtostderr' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLB::FLAGS_alsologtostderr' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLB::FLAGS_nologtostderr' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLB::FLAGS_logtostderr' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLI::FLAGS_nostderrthreshold' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLI::FLAGS_stderrthreshold' in:
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(logging_1c50ea684ad2fde4aa9d3832c43a57ad.o)
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(logging.o)
duplicate symbol 'fLI::FLAGS_nov' in:
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(vlog_is_on.o)
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(vlog_is_on_94102400bc1882a13cea0800c3a3a9ef.o)
duplicate symbol 'fLI::FLAGS_v' in:
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(vlog_is_on.o)
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(vlog_is_on_94102400bc1882a13cea0800c3a3a9ef.o)
duplicate symbol 'fLS::FLAGS_vmodule' in:
/Users/name/Library/Developer/Xcode/DerivedData/tcapp-fxwrsskmvzcadqerqdzaoopqzsqu/Build/Products/Debug-iphoneos/libReact.a(vlog_is_on.o)
/Users/name/Documents/projects/app_name/ios/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.4_static/GoogleCast.framework/GoogleCast(vlog_is_on_94102400bc1882a13cea0800c3a3a9ef.o)
ld: 13 duplicate symbols for architecture arm64
From your errors, Did you try to delete files in DerivedData folder?
Edit : Few days later I fixed duplicate issue by remove "-all_load" in Build Settings > Other Linker Flags
As mentioned here https://issuetracker.google.com/issues/113069508 as a workaround you can use the dynamic SDK and go through the manual Setup https://developers.google.com/cast/docs/ios_sender
in my project I have to foreign SDKs. The first sdk always work with the flag -ObjC and -all_load and the second doesn't need these flags. If I set the two flags for my second sdk I get some duplicate symbols messages. If I remove the flags the first sdk give back the error unrecognized selector sent to instance.
How can I fix this problem ? Is there a way to say that the flags -ObjC and -all_load are exclude from the second sdk ?
Edit:
The first sdk is the dropbox iOS sdk and it was installed over pod and need the flags -ObjC and -all_load.
The second sdk have some .h and .m files and a linked library libMTProtocol.a.
If the flags are enabled in other linker flags, I get the following duplicate messages :
duplicate symbol _OBJC_CLASS_$_MTExchangeDataThermoFrameFactory in:
duplicate symbol _OBJC_METACLASS_$_MTExchangeDataThermoFrameFactory in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._warningHumidity in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._warningDewPoint in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._packetNumber in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._warningAmbTemp in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._timestamp in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._laserOn in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._alarm in:
duplicate symbol _OBJC_CLASS_$_MTExchangeDataThermoInputMessage in:
duplicate symbol _OBJC_METACLASS_$_MTExchangeDataThermoInputMessage in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._mode in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._temperatureMode in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._autoSync in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._measID in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._uniqueID in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._component3 in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._component2 in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoInputMessage._component1 in:
duplicate symbol _OBJC_CLASS_$_MTExchangeDataThermoMessageFactory in:
duplicate symbol _OBJC_METACLASS_$_MTExchangeDataThermoMessageFactory in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoOutputMessage._packetNumber in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoOutputMessage._syncControl in:
duplicate symbol _OBJC_CLASS_$_MTExchangeDataThermoOutputMessage in:
duplicate symbol _OBJC_METACLASS_$_MTExchangeDataThermoOutputMessage in:
duplicate symbol _OBJC_IVAR_$_MTExchangeDataThermoOutputMessage._mode in:
ld: 26 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
All duplicate symbols are references on the libMTProtocol.a library.
I'm using paho MQTT library in my project.
And when I build the project on simulator , I got the following errors.
duplicate symbol _client_version_eye in:
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTClient.o
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTAsync.o
duplicate symbol _Log_levels in:
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTPacket.o
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTAsync.o
duplicate symbol _Log_levels in:
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTPacket.o
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTProtocolClient.o
duplicate symbol _Log_levels in:
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTPacket.o
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/Socket.o
duplicate symbol _Log_levels in:
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTPacket.o
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTPersistence.o
duplicate symbol _Log_levels in:
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTPacket.o
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/Thread.o
duplicate symbol _Log_levels in:
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTPacket.o
/Users/xieweizhi/Library/Developer/Xcode/DerivedData/mgiosapp-bctgnqpjhalyqageaduowfwrsrkh/Build/Intermediates/mgiosapp.build/Debug-iphonesimulator/mgiosapp.build/Objects-normal/i386/MQTTProtocolOut.o
ld: 25 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
MQTTClient.c and MQTTAsync.c should not be included in the same project. They are used to build different libraries. Decide whether you want the blocking or async behaviour and use that file.
Try it....
The error may occur when you copy and paste the contents of one file to another file with its interface name which means two classes with same interface name.
In your code you have two different files with the same Interface name.
The problem is most likely due to a typo when including the header.
Check so that the header file (.h) is included and not the implementation file (.m).
Also Clean your project and build folder sometimes it will also solve this error
Also delete the derived data.
I gone through question already asked on forum. Getting error as below
ld: 8 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
More error description is below
ld: warning: directory not found for option '-L/Users/Documents/Sprint1/iPhone/MyApplication/MyApplication/lib/lib'
ld: warning: directory not found for option '-Lrestkit'
ld: warning: ignoring file /Users/Documents/Sprint1/iPhone/MyApplication/MyApplication/lib/lib restkit/libRestKit.a, missing required architecture i386 in file /Users/Documents/Sprint1/iPhone/MyApplication/MyApplication/lib/lib restkit/libRestKit.a (2 slices)
duplicate symbol _OBJC_IVAR_$_Reachability.reachabilityRef in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
duplicate symbol _kReachabilityChangedNotification in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
duplicate symbol _kInternetConnection in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
duplicate symbol _kLocalWiFiConnection in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
duplicate symbol _OBJC_IVAR_$_Reachability.key_ in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
duplicate symbol _OBJC_CLASS_$_Reachability in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
duplicate symbol _OBJC_METACLASS_$_Reachability in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
duplicate symbol _kConnectionDown in:
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Intermediates/MyApplication.build/Debug-iphonesimulator/MyApplication.build/Objects-normal/i386/Reachability.o
/Users/Library/Developer/Xcode/DerivedData/MyApplication-bchgbqjzuwjzbcbnhwyihhatsoyw/Build/Products/Debug-iphonesimulator/libPOSNirvanaUtils.a(Reachability.o)
ld: 8 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have project structure like
Application
Static library A
Static library B
Situation
1) Static library A depend on static library B. The project A require Reachability check.
2) Added static library A into Application project
3) When I compile,getting linker error
Please help to resolve this issue.
If this solution is not working then check this..
Another reason this error often happens is accidentally importing the .m file instead of the .h.
Steps:
1.Check Build phases in Target settings.
2.Check if any file exists twice or once.
3.If file exist twice delete one. If not delete file in the bottom which is the latest one.
4.Build again.
You have Reachability class in libPOSNirvanaUtils.a & your Application and you are using libPOSNirvanaUtils.a in your application. So now your application has 2 reference of Reachability class.
If you are building libPOSNirvanaUtils.a then you can solve this with 2 ways:
Remove Reachability class membership from target libPOSNirvanaUtils.a
Add Reachability class in Copy files, remove Reachability class reference from your Application and use same class reference from libPOSNirvanaUtils.
I had the same problem while using prepareforsegue delegate. It turns out, I accidentally imported the .m file instead of the .h file. This will fix it. Look at your #import statements before you go crazy adding and deleting frameworks.
In my case I got this error because had the same named variables declared in several files in implementation part.
#implementation A
int a;
...
#implementation B
int a;
...
gave me "duplicate symbol _a ..."
I want to use 2 different framework in my project. The frameworks are DropboxSDK.framework and Dropbox.framework. But 2-3 files are common in both these framework which are not allowing me run the application and are giving linker error as following.
duplicate symbol _kDBDropboxAPIVersion in:
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/DropboxSDK.framework/DropboxSDK
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/Dropbox.framework/Dropbox(DBConstants.o)
duplicate symbol _kDBDropboxAPIHost in:
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/DropboxSDK.framework/DropboxSDK
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/Dropbox.framework/Dropbox(DBConstants.o)
duplicate symbol _kDBDropboxAPIContentHost in:
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/DropboxSDK.framework/DropboxSDK
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/Dropbox.framework/Dropbox(DBConstants.o)
duplicate symbol _kDBDropboxWebHost in:
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/DropboxSDK.framework/DropboxSDK
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/Dropbox.framework/Dropbox(DBConstants.o)
duplicate symbol _kDBSDKVersion in:
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/DropboxSDK.framework/DropboxSDK
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/Dropbox.framework/Dropbox(DBConstants.o)
duplicate symbol _DBErrorDomain in:
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/DropboxSDK.framework/DropboxSDK
/Users/sanchit/Documents/Documents/Projects/VoicePrompt/VoicePrompt 2/Dropbox.framework/Dropbox(DBError.o)
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have to use both of these framework for different reasons. One framework is not sufficient to do all the things. Is there any way by which I can achieve my target. Please advise.
Thanks in advance
I had same issue with following files
DBAccountInfo
DBConnectController
DBError
DBKeychain
DBSession+iOS
DBSession
I have suffixed "Old" to these class names my problem is solved
DBAccountInfoOld
DBConnectControllerOld
DBErrorOld
DBKeychainOld
DBSessionOld+iOS
DBSessionOld