0

I've got a executable target called Foobar, a static library holding some common code called FoobarCommon, and a test target specifically for the common code called FoobarCommonSpecs.

Unsurprisingly, I have made both Foobar and FoobarCommonSpecs depend on the FoobarCommon library.

The Podfile looks something like the below:

target 'FoobarCommon' do
  pod 'ReactiveCocoa'
  ...
end

target 'Foobar' do             # links against to FoobarCommon in Xcode
   ...
end

target 'FoobarCommonSpecs' do  # links against to FoobarCommon in Xcode
  pod 'LLReactiveMatchers', :git => 'https://github.com/lawrencelomax/LLReactiveMatchers.git'
end

LLReactiveMatchers is a Pod that depends on ReactiveCocoa.

Note that in this situation, ReactiveCocoa is prsent in both FoobarCommon and also in FoobarCommonSpecs

The Problem

Whenever I run FoobarCommonSpecs, I get many duplicate symbol errors for ReactiveCocoa.

I want to say to Cocoapods that it should just IGNORE LLReactiveMatcher's dependency on ReactiveCocoa. It should just let Xcode do its job and it should link with the copy of ReactiveCocoa found in FoobarCommon. How do I do that?

Does the link_with directive have anything to do with anything?

3
  • I've worked around this issue by simply including all the sources of LLReactiveMatchers into my project sources, bypassing Cocoapods. This really isn't ideal...
    – fatuhoku
    Jul 29, 2014 at 21:53
  • I found this article useful when I ran into the problem Duplicate Symbols when using CocoaPods
    – Dave Green
    Aug 13, 2014 at 7:08
  • Haha. Good find — I had read that page already. It offers a few hints. Many users use 'the power of Ruby' to define functions that help group up the dependencies into logical groupings. However, doing this for multiple targets very severely increases the amount of time it takes to perform a pod install operation, because of many many more project files that get generated.
    – fatuhoku
    Aug 14, 2014 at 22:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.