Bodlund Bodlund - 1 year ago 125
iOS Question

Create Private CocoaPod that uses other Pod

I am trying to create a private CocoaPod that I will use/install in another project lets call my pod "MyPod" and my project "MyProject".
MyPod is depending on another pod called BMSSecurity. Here you can see the Podfile for MyPod:

target 'MyPod' do
pod 'BMSSecurity'

MyPod can be built just fine and BMSSecurity is imported
I am following the guides to create a private pod but when I install MyPod in MyProject with pod install everything looks fine except that the pod BMSSecurity in MyPod is not installed so MyProject won't build.
MyProject can't find the files needed from BMSSecurity
Here is the Podfile for MyProject:

target 'MyProject' do
pod 'MyPod', :path => '../MyPod'

../MyPod is the location where the specfile for MyPod is located

How can i get Cocoapods to understand that it need to install the pods in the pod?

Answer Source

Add BMSSecurity pod as a dependency of your private pod. In your .podspec file: do |s|             = 'MyPod'
    s.version          = '1.0.0'
    s.summary          = 'A short description of MyPod.'

    # ...

    s.dependency 'BMSSecurity'

    # ...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download