Xcode + AWS Integration Apple Mach-O Linker Error - ios

I have a very simple Xcode project that I started and am now trying to integrate the Amazon Web Service (AWS) SDK into my project. I followed the instructions posted on their instruction page and everything looks good EXCEPT that I've got the following output...
duplicate symbol _OBJC_CLASS_$_XMLDictionaryParser in:
/Volumes/Macintosh HD/Users/ryanmord/Library/Developer/Xcode/DerivedData/FocalApplication-brblhwteebzxgycscfnynvdcptjx/Build/Products/Debug-iphonesimulator/libPods-XMLDictionary.a(XMLDictionary.o)
/Volumes/Macintosh HD/Users/ryanmord/Downloads/aws-ios-sdk-2.1.2/third-party/XMLDictionary.framework/XMLDictionary(XMLDictionary.o)
duplicate symbol _OBJC_METACLASS_$_XMLDictionaryParser in:
/Volumes/Macintosh HD/Users/ryanmord/Library/Developer/Xcode/DerivedData/FocalApplication-brblhwteebzxgycscfnynvdcptjx/Build/Products/Debug-iphonesimulator/libPods-XMLDictionary.a(XMLDictionary.o)
/Volumes/Macintosh HD/Users/ryanmord/Downloads/aws-ios-sdk-2.1.2/third-party/XMLDictionary.framework/XMLDictionary(XMLDictionary.o)
ld: 5771 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is the very end of the output, but as the 2nd to last line says, I've got 5771 other duplicate symbols worth of output as well. Im not sure if this is related to the "clang error" that Im getting, but regardless this is a roadblock for me that I can't figure out. I've seen recommendations from duplicate libraries, to changing the valid architectures in my project, but I'm not sure what will break my app and what won't. Any help would be greatly appreciated!!
Cheers

Are you importing the AWS Mobile SDK for iOS using both the frameworks and CocoaPods? You cannot import the SDK twice, and that is why you are getting duplicate symbols errors. You need to pick one of them and remove the other one to remove the errors.

Related

Apple Mach-O Linker Error when Facebook installed using pods in the project

I have just installed the Facebook using pods and now my project is not working and says. Please help someone.
Apple Mach-O Linker Error
ld: 87 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
duplicate symbols for architecture means your files are doubled, Please check if you have added facebook framework manually before using pods
you can also check files duplicating by seeing whole description of error
Solution 1
You need to do this:
Click on your project (targets) Click on Build Settings Under Library Search Paths, delete the paths May be this will help you.
Solution 2
You have duplicate symbol method which means there are duplicate file in project
In your Target's Build Phase, under "Compile Sources" check if there are duplicate file and delete one if you have duplication.
Hope this will help you.

SMCalloutView duplicate symbol linking error iOS

Im using mapbox and I need to customise annotation for it. For that I found that we can use SMCalloutView.
But when I integrated SMCalloutView into xcode project, then it started giving linking duplicate symbol errors.
/Users/xxx/Library/Developer/Xcode/DerivedData/mapboxDemoWithCustomAnnotation-ebmsoyqrqzxuouckyxxwhjbcakwf/Build/Intermediates/mapboxDemoWithCustomAnnotation.build/Debug-iphonesimulator/mapboxDemoWithCustomAnnotation.build/Objects-normal/x86_64/SMCalloutView.o
/Users/xxx/Desktop/mapboxDemoWithCustomAnnotation/Pods/Mapbox-iOS-SDK/Mapbox.framework/Mapbox(SMCalloutView.o)
ld: 38 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone help me on this?
The problem you have is that somewhere you are including the SMCalloutView file twice which is being compiled twice.
Its a drawback for objective-c as you cannot have the same name of an object twice.
I would first, check in your project if you have included the smcalloutview file in your project.
Start by looking your project(like mine, the Movei project) this should NOT include smcalloutview class.
SMCalloutView should only exist in the Pods project.

Getting Error on compiling project with Parse

I have followed all the steps specified https://www.parse.com/apps/quickstart#parse_push/ios/native/existing and also tried to add Parse Framework from cocoPods but still getting these following duplicate symbol errors, the IOS min version is 7.0 and objective c is used.
The errors are:
duplicate symbol _BFTaskMultipleExceptionsException in:
/Users/sabaanwar/Library/Developer/Xcode/DerivedData/Project1-bybalqattilbrydhswfphyvovcre/Build/Intermediates/Project1.build/Debug-iphoneos/Project1.build/Objects-normal/arm64/FLAnimatedImageView.o
/Users/sabaanwar/Library/Developer/Xcode/DerivedData/Project1-bybalqattilbrydhswfphyvovcre/Build/Intermediates/Project1.build/Debug-iphoneos/Project1.build/Objects-normal/arm64/BaseNetworkModel.o
duplicate symbol _BFTaskMultipleExceptionsException in:
/Users/sabaanwar/Library/Developer/Xcode/DerivedData/Project1-bybalqattilbrydhswfphyvovcre/Build/Intermediates/Project1.build/Debug-iphoneos/Project1.build/Objects-normal/arm64/FLAnimatedImageView.o
.
.
.
ld: 161 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It appears that you are trying to compile the same code twice. This is throwing you an error and may have been caused by you installing the library and also the cocoaPods file. Another possible reason would be that you have same class implementation into two different files. However, I wouldn't expect that with a third party library.
In order to fix that, the easiest way would probably to just delete the project ans start with a clean one. If that isn't possible, delete the cocoaPod, delete the framework and any files that you installed, clean the cache and build the project. It should compile without any problem. Then just install the SDK once.
Hope that helps, Julian
Found the solution over here: https://stackoverflow.com/a/29724276/4841900
The reason was Bolts and FacebookSDK were conflicting each other so i was getting duplicate symbol errors.

Error Building Xcode Project after installing AFNetworking via CocoaPods

I am facing the following error when I am attempting to build my Xcode Project after installing AFTNetworking 2.4.1 for iOS 7.1 via CocoaPods..
duplicate symbol _main in:
/Users/nnayudu/Library/Developer/Xcode/DerivedData/Fuse-hksjwkrntgavgvflwlisdncfjobw/Build/Intermediates/Fuse.build/Debug-iphoneos/Fuse.build/Objects-normal/arm64/main-2A00476E021EE59C.o
/Users/nnayudu/Library/Developer/Xcode/DerivedData/Fuse-hksjwkrntgavgvflwlisdncfjobw/Build/Intermediates/Fuse.build/Debug-iphoneos/Fuse.build/Objects-normal/arm64/main-31DB0C4487DDF7B.o
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Additionally in the file browser of Xcode, libPods.a and libPods-AFNetworking.a are red.
I have tried removing arm64 from architectures, building and cleaning CocoaPods multiple times and can not seem to get rid of this error. I also tried adding $(PODS_ROOT) to framework search paths without avail.
Is there a possible solution that exists for this problem?
Please help me out.
There was no problem with the installation of AFNetworking and the error was due to a duplicate .xcodeproj file from past code hidden away in the project.

duplicate symbol of _main in Tesseract libtesseract_all.a(svpaint.o)

I've clone the project of "iPhone-OCR-Tesseract-and-OpenCV" from Github, installed its pod, compiled files and it works great.
However, I try to merge the pod file with my existing one and compile it, I have an issue that shows
duplicate symbol _main in:
/Users/ivanlin/Library/Developer/Xcode/DerivedData/MailTracker-duddjrlaosmnafgcbrqibnzstqws/Build/Intermediates/MailTracker.build/Debug-iphoneos/MailTracker.build/Objects-normal/armv7/main.o
/Users/ivanlin/Documents/Projects/MailTracker/Pods/Tesseract/lib/libtesseract_all.a(svpaint.o) ld: 1 duplicate symbol for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems that there is another main function in the Tesseract library.
I am wondering why this issue does not show up in the original project.
I try to compare possible compile and link options between the original project and mine and there is no clue.
If anyone have experience to address this issue, please help a bit. I will very appreciate.
Many thanks.
To answer my own question.
I've found the root cause and it is not relevant to re-including a main file.
After comparing "iPhone-OCR-Tesseract-and-OpenCV" and my own project, I found that my project has an additional linker option which is "load_all".
After removing out this "load_all" option, the issue is gone.
I am not sure why it cases the issue, but it is a solution in my case.

Resources