SMCalloutView duplicate symbol linking error iOS - 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.

Related

Cocoapods : ld: library not found for -lBolts

I am using cocoapods in one of my projects and after I cleaned the derived data for my project I have started seeing this error
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/Bolts'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/DownPicker'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/MBProgressHUD'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/Parse'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/SCLAlertView-Objective-C'
ld: library not found for -lBolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I open up the Debug-iphoneos from Window > Projects I do not see any folders in there now. Since this problem started cropping up after cleaning derived data I do not really know what did I do which stopped generating those folders.
This is how it looks :
This is kind of how it should look, I imagine (From a different project)
I have tried what was suggested here
Cocoapods ld: library not found for -lPods-Projectname
Cocoapods ld: library not found for -lPods-ObjectiveSugar
And a couple more things which I have tried but to no avail, I have faced my fair share of cocoapod niggles. This seems beyond me.
EDIT: I have been doing some more tests with this, I realized that my pods are not even building ! When I clear derived data for any other project, it goes ahead and builds the Pods next time I try to build the project, but not in this project. What setting can wrong ?
This is how the project looks right now :
Any help will be appreciated.
Clean up cocoa pods and install them again.
You can also use tool - https://github.com/CocoaPods/cocoapods-deintegrate
Somehow the option of Find Implicit Dependencies got turned off in the build scheme. SMH.
Hope this can help someone in the future.

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.

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.

Linking Errors while integrating SKMaps.Framework

Getting these error while trying to integrate SKMaps framework
Undefined symbols for architecture x86_64:
"CRouteTestManager::calculateRoute(NGRouteInput const&, std::__1::shared_ptr<CRoute>&)", referenced from:
PoiTrackerTest::createRoute() in SKMaps(PoiTrackerTest.o)
"_gpTestRoutesManager", referenced from:
PoiTrackerTest::createRoute() in SKMaps(PoiTrackerTest.o)
createNavigationObject(int) in SKMaps(NavigationTest.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please help me resolve this error.
Environment :
Xcode 6.3.1, Mac OSX 10.10.3
Deployment Target iOS7.0
Supports Swift.
i was following this guide : http://developer.skobbler.com/getting-started/ios
and also added CoreMotion.framework as there were also linking errors related to that framework.
Cause of Linker Error
This appears to be the result of the linker flag -all_load, which may have been added to your project through a CocoaPod. In the rare case that you have a static library with nothing but categories defined then you need this flag. Otherwise, it can be safely removed from your build. See discussion here:
What does the -all_load linker flag do?
From a link in the comments section on that discussion you can see that this bug that previously required -all_load has been fixed since XCode 4.
Objective-C categories in static library
Probable Explanation
This framework has a bunch of tests defined inside, but their dependencies are not included in the framework. When the linker is forced to resolve and link all dependencies, it errors out because it cannot find them. Basically, the library should be cleaned up so that it doesn't contain these unnecessary symbols. The work around is to remove -all_load for the time being.
Faced with the same problem. Deleting -all_load flag did not help, so I continued to research and found a solution:
Despite the fact that Skobbler declares the need for linking the libc++ library, in reality you need to link libstdc++.6 library. Note that linking libstdc++ will not help.
P.S. Xcode 6.4, iOS SDK 8.4

Linker errors building iOS app with Simperium

I'm getting linker errors when integrating Simperium into my app:
ld: duplicate symbol _OBJC_CLASS_$_DDASLLogger in
/Users/zulfi_shah/Documents/ContactsJournal-TestSimperium/SimpleList/Simperium.framework/Simperium(DDASLLogger.o) and
/Users/zulfi_shah/Library/Developer/Xcode/DerivedData/SimpleList-cxdtxuubxyczhgcyxbixtjtvzkct/Build/Intermediates/SimpleList.build/Debug-iphonesimulator/SimpleList.build/Objects-normal/i386/DDASLLogger.o
for architecture i386 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
The issue seems to be with DDASLLogger which is included in CocoaHTTP package. I also saw the same issue with Reachability classes before.
How do I ensure Simperium framework plays nice with other libraries in my binary?
Thanks.
We're updating the library on our end to avoid these name clashes. This should be fixed soon.
In the meantime, if you encounter this problem (with Simperium or any other library) you can remove your own versions of the conflicting library from your target. You can do this in a couple ways:
Select each corresponding file for the conflicting library, open the browser on the right, and uncheck the box next to your target name.
Select your Project, then your target, go to Build Phases | Compile Sources, and remove the source files for the conflicting library.
This is not very friendly, hence why we'll be fixing it soon.

Resources