duplicate library issue in XCode - ios

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.

Related

What is the usage of OTHER_LDFLAGS in podspec?

My project has various plugins, and every plugin associate with one podspec file. e.g. I have coreSDK plugin in which we have core functionality for project. In coreSDK podspec we added few dependencies for google, Facebook and twitter.
Currently Im working social integration for all three framework but I observed these three frameworks are not showing added to coreSDK target because of that I am not getting social framework access. One of my friend suggested me to add those frameworks in OTHER_LDFLAGS so that they will get added to coreSDK target.
I will do this but before that I want to know what is the purpose of OTHER_LDFLAGS in podspec. How it works?
OTHER_LDFLAGS is nothing but Other Linker Flags. It causes the actual pods to be linked into your application.
This flag is used by xcodebuild which uses it when calling ld linker to link an app target with a frameworks and indicate in which languages they were written.

Could not build module Foundation

I am using a sub-project which has a C++ library that it uses and this project has a SDK that I am trying to use.
I have several projects that I am trying to build, each of which use this SDK. I have some targets that compile fine but then I have some that tell me Could not build module: Foundation.
As I said this happens in some but not all of my targets, I was able to get some to work by clearing the linker flags but this does not fix it on all targets. So it seems weird to me that some targets work fine while others do not.
I have tried:
Removing linker flags
Reinstalling Xcode
Messing with header search paths
Any suggestions? I've been stuck on this for a while.
As don't have more information in question here.
Try making
Allow Non-modular Includes in Framework Modules
to Yes in your Build Settings.

Paylpal integration with other static libraries not working

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.

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'

RestKit in a Workspace

I have a workspace set up in Xcode. It contains a number of static library projects that I link to in my main project.
The process of linking to these projects is much longer than it should be. But the key for me in getting this to work was removing the -ObjC linker flag from my build settings. This kept me from getting duplicate files when I used a library in more than one place.
But this gave me a problem when trying to include RestKit in my project, because the documentation says that the -ObjC linker flag is necessary, which I have found to be the case.
Is there a way of including RestKit in a workspace like this and linking to it like any other static library? Without having to use the -ObjC linker flag?
If you are planning to target your app for IOS 5 and above then you can try using the built-in NSURLConnection along with NSJSONSerialization class (If you return JSON response) for the purpose.

Resources