Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
766 views
in Technique[技术] by (71.8m points)

ios - 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 ~/.cocoapods/repos/MySpecs

I have referenced PrivateSpec within PrivateClientSpec as follows:

s.dependency 'PrivateSpec' '~> 0.1.0'

The problem is that when I try to lint this PrivateClientSpec, 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.

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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,https://github.com/CocoaPods/Specs'

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 https://github.com/CocoaPods/Specs too.

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

--sources=https://github.com/artsy/Specs   The sources from which to pull
                                           dependant pods (defaults to
                                           https://github.com/CocoaPods/Specs.git).
                                           Multiple sources must be
                                           comma-delimited.

More on this here and here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...