chrisco chrisco - 26 days ago 9x
iOS Question

Cocoapods: Unable to find a specification for [PrivateSpec] depended upon by [PrivateClientSpec]

I am trying to use private repositories to break up a larger application. I have followed the guides at:

I have created a local repository to contain the specs, published to cocoapods via

pod remote add MySpecs ~/local/path/to/MySpecs.git

verified that cocoapods sees them by looking at the contents of

I have referenced
as follows:

s.dependency 'PrivateSpec' '~> 0.1.0'

The problem is that when I try to lint this
, I get the titular error:

Unable to find a specification for [PrivateSpec] depended upon by [PrivateClientSpec]

Am I missing something? From what I understand, this is supported behavior. I am using cocoapods v0.35.



The reason is that the pod spec linter is only checking the master specs, so it can't find your private one.

You'll need to use the --sources option, like this:

pod spec lint --sources='git@our-private-spec-repo:iOS/Specs.git,'

Two things two note:

  • Your private specs need to be online, can't check on a local one
  • If you depend on other pods you'll need to add the URL for their Spec repo too, that's why in the example we have too.

By running pod spec lint --help you can read more about this option:

--sources=   The sources from which to pull
                                           dependant pods (defaults to
                                           Multiple sources must be

More on this here and here