Cocoapods: Cannot add a private pod as a dependency to a private pod

Created on 11 Jul 2017  路  4Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

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.

What did you expect to happen?

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.

What happened instead?

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 Environment

Stack

   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

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

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

Podfile

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

Most helpful comment

Does it help to switch the order of the sources?

pod spec lint --sources=my-private-repo,master

All 4 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

soleares picture soleares  路  3Comments

steffendsommer picture steffendsommer  路  3Comments

luhui picture luhui  路  3Comments

dawnnnnn picture dawnnnnn  路  3Comments

gerchicov-bp picture gerchicov-bp  路  3Comments