Paylpal integration with other static libraries not working - ios

I am using multiple static libraries in my project and I am trying to use Paypal SDK but getting linker error(duplication of symbol) as for paypal we have to set -lstdc++ and -ObjC in other linker flags.When i am removing all of my libraries it is working and if i remove -ObjC project is running but crashing when calling paypal. Any idea why can't I set -ObjC when using static libraries in our main project? Thanks in advance

Are you using -lc++? If so, try removing it. There's a known issue around this that will be resolved in an upcoming release.

i resolved it by setting -force_load "full path of paypallib.a" in other linker flags by this we will force our library to be loaded.

Related

duplicate library issue in XCode

I have been facing an issue in my project when I build my project.
I integrated a third party framework which contains same JSONModel library which I have used in my Project. So it causes duplicity when project is build.
Is there any way to solve without removing JSONModel from my project.
Note: I have not defined -all_load flag in 'Other linker flags' in build settings.
Any help is appreciable.

Getting compilation errors & warnings after install Soundcloud API through CocoaPods in Xcode

Having problems with the Soundcloud API.
I'm getting multiple Warnings & issues and I don't know what can I do to fix that.
Have I to change header search paths & other link flags? I tried the Terminal version of Installation as well and I got warnings & compilation errors
Appreciate your helping, I'm stuck trying to run propertly the Soundcloud API without warnings and I'm not able to do that.
I attach some screenshots.
Thanks
This looks a lot like a duplicate of XCode - iOS: Can't resolve conflict between CocoaLibSpotify and Parse framework.
I'm making a guess here, but are you doing -all_load?
Remove -ObjC and -all_load
Add -force_load <SoundCloudAPI library path> to load only libSoundCloudAPI.
After reading the github page, you may not need -force_load at all.
You may also need to adjust your warning level because of all the deprecated APIs.
It's working!!! Thanks for your help!! I'm very happy :D I was forcing the loading of the libraries without the prefix libPods that is added installing the project through CocoaPods. The trick to hidden the Deprecated functions was really helpful. After one day trying different settings, its running.
These are the linker flags I put in "Other Linker Flags"
-force_load $(BUILT_PRODUCTS_DIR)/libPods-OHAttributedLabel.a
-force_load $(BUILT_PRODUCTS_DIR)/libPods-CocoaSoundCloudUI.a
-force_load $(BUILT_PRODUCTS_DIR)/libPods-CocoaSoundCloudAPI.a
-force_load $(BUILT_PRODUCTS_DIR)/libPods-NXOAuth2Client.a
In "Header Search Paths" I put "./**"

Duplicate symbol for armv7s Sharekit and admob

I have application which is using Sharekit and Admob together, app is not compiling because of the dublicate symbols. The problem is that Sharekit requires -all_load flag but this flag is conflicting with admob plugin, but i cant remove the all_load flag and put only ObjC flag because in that case Sharekit won't create the instance of some classes.Maybe someone has the same issue , how to fix it ?
This is a common problem when using multiple third-party libraries. If you’re importing them as static libraries, you can strip the duplicate symbols yourself: http://atnan.com/blog/2012/01/12/avoiding-duplicate-symbol-errors-during-linking-by-removing-classes-from-static-libraries
If you have the source code and are compiling the libraries, simply rename the relevant symbols to avoid a conflict.
The problem is solving just by replacing -all_load flag to -force_load.
it should look like this
-force_load $(BUILT_PRODUCTS_DIR)/libShareKit.a

Restkit and opencv2 framework

In my project in using restkit to connect to the webservice and I need to use opencv for image processing. Currently I have integrated restkit and having linker flag for it as -all_load and -ObjC in build settings which working fine. Now I integrate the opencv2 and it is giving me the linker error. if i remove the all_load and -Objc linker flag it is working fine but restkit is not sending the request.
Any help on this is highly appreciated. Thanks in advance.
Remove all_load and -ObjC flags. Instead, add force_load $(BUILT_PRODUCTS_DIR)/libRestKit.a
It should work.

Significance of -ObjC value in Other Linker Flags: GMaps SDK

I was trying out google maps sdk integration with iOS 6.1. I am successfully able to populate gmap on iOS simulator by using instructions given on
GMaps for iOS starting guide
Then what the issue with it:
It works great when I use it as a separate project. But when I club the above project code with my existing application, then it behaves weird, and all the errors generates due to inclusion of -ObjC value in Other Linker Flags in Build Settings.
Error
duplicate symbols for architecture i386
When I skip step 7 (GMaps iOS), it doesn't give errors. Due to exclusion of -ObjC value, it doesn't able to identify a specific GMaps library class and its method:
[GMSCameraPosition cameraWithLatitude:longitude:zoom:]: unrecognized selector sent
My iOS application background:
Using a third party library SUP (Sybase Unwired Platform). Connecting SAP to iOS application. I guess there is something ambiguous with SUP environment enablement (Build settings) when I am trying to add GMaps library.
Seeking for your advices.
Thanks!
There many posts on SO about the duplicate symbols for architecture i386 error. Usually it means that you defined the same symbol twice in the one namespace. The last time I got this error was because I accidentally included a .m file instead of .h header file.
Have you checked the Build Architecture?
Try setting Build Active Architecture Only to Yes.
I was facing the same issue Today! -ObjC linker flag - When trying to add it to "Other Linker Flags" I get an error
I solved my problem, Here is what I'd suggest. Take your original project (without Gmaps and with SUP) and add the -ObjC flag to it. Are you still getting an error? If so, take Gmaps out of the equation. If you are still getting an error check in the warnings about which files it is warning you about. My problem was that I had two files libGoogleAnalytics.a and libGoogleAnalytics_debug.a and for some reason they could not coexist with the -ObjC.
Long story short, you need to find what libraries Gmaps is using that you already have in your project and remove one of them.
Please try this…
step 1: Add '-ObjC' to other linker flags in 'Build Settings' of your 'target' only not to the 'project'

Resources