I created a pod (names redacted, so will use example names) called ModelPod, it's private pod using a private repo. The pod handles all my model and persistence. This passed lint and was repo pushed to my private repository. I can install it via a pod file outside of this scenario.
Now I want to create my ApplicationPod, this will need ModelPod and using that model has a number of services that can be called. ApplicationPod passes lint when I don't have ModelPod as a dependency (as currently the pod does nothing), however once I add ModelPod as a dependency, it will no longer pass lint, stating:
-> ApplicationPod (0.1.0)
- ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for 'ModelPod (~> 0.1.0)' depended upon by 'ApplicationPod') during validation.
Please note I ran this command with '--sources=' set to both master and my private pod repo:
pod spec lint --sources=master,my-private-repo
Also to cover all bases, my pod repo list looks like this:
- Type: git (master)
- URL: https://bitbucket.org/abc/my-private-repo
- Path: /Users/ME/.cocoapods/repos/my-private-repo
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/ME/.cocoapods/repos/master
Before anyone assumes that ApplicationPod should be a subspec. That's not what i'm trying to achieve here. ModelPod can and will be used in different ways with different pods. Also ApplicationPod and ModelPod are just names I made up for here, the actual pod names are irrelevant.
I expected the podspec to pass lint as I passed my source that contains the pushed pod.
Maybe cocoapods can't do this, but nothing in the documentation suggests it cannot.
It failed to pass validation with the message:
-> ApplicationPod (0.1.0)
- ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for 'ModelPod (~> 0.1.0)' depended upon by 'ApplicationPod') during validation.
CocoaPods : 1.3.0.beta.2
Ruby : ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
RubyGems : 2.6.12
Host : Mac OS X 10.12.4 (16E195)
Xcode : 8.3.2 (8E2002)
Git : git version 2.11.0 (Apple Git-81)
Ruby lib dir : /usr/local/Cellar/ruby/2.4.1_1/lib
Repositories : [REDACTED!]
master - https://github.com/CocoaPods/Specs.git @ 1b14a66d398ecbf9bdf5f358f53cbb3a4bf8f1e0
Executable Path: /usr/local/bin/pod
cocoapods-deintegrate : 1.0.1
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.2.0
cocoapods-try : 1.1.0
use_frameworks!
source [REDACTED!]
source 'https://github.com/CocoaPods/Specs.git'
target 'ApplicationPod_Example' do
pod 'ApplicationPod', :path => '../'
target 'AuthenticationService_Tests' do
inherit! :search_paths
pod 'ApplicationPod', :path => '../'
end
end
Does it help to switch the order of the sources?
pod spec lint --sources=my-private-repo,master
Please provide sample app if you want us to debug. Its downright impossible to debug issues with hidden sources and podspecs.
Hey I'm having the same issue, trying to make work two private pod one depending of the other, inside the pod spec, with no luck
s.dependency 'Logger'
--sources=my-private-repo,master
@paulb777 brilliant, thanks for the help!
Most helpful comment
Does it help to switch the order of the sources?
pod spec lint --sources=my-private-repo,master