I am trying to build a static library that has different dependencies (AFNetworking for example) specified in a Podfile. I don't want the dependencies to be included in the final static library (call libMyProject.a), I just want to link against them and then create a MyProject.Podspec file where I can put the same dependencies.
The problem is that when I build libMyProject.a the libPods.a is linked and included, so that if I distribute libMyProject.a and other people integrates it in a project which uses some of the same dependencies it will have duplicate symbols issues.
How can I link against the libPods.a lib but not include it in libMyProject.a? It should work just like linking with other existing frameworks.
Thanks!
Integrating static library pods into static library targets will not cause copy script phases to be run CocoaPods 1.5.0 is an exciting release. We're very excited for you to try it out, and recommend you upgrade:
With CocoaPods 1.5.0, developers are no longer restricted into specifying use_frameworks! in their Podfile in order to install pods that use Swift. Interop with Objective-C should just work .
However, if your Swift pod depends on an Objective-C, pod you will need to enable "modular headers" (see below) for that Objective-C pod. When CocoaPods first came out many years ago, it focused on enabling as many existing libraries as possible to be packaged as pods.
Just a few months after the release of CocoaPods 1.4.0, we're releasing a new version that focuses on enabling everyone to adopt Swift. Up until Xcode 9, support for building Swift into static libraries was non-existent and use of dynamic frameworks was required.
I solved it by removing the libPods.a lib from the section "Link Binary With Libraries" in Build Phases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With