31

I am working on a private pod and that is dependent on other private pod. So i just want to mention it in my pod .podspec file.

Its looks like this in .podspec file of pod2.

s.dependency 'Pod1', '~> 0.0.1' , :git => 'https://github.com/MY_COMPANY/pod1.git', :commit => '9f9f4fe5b5959e0f2ea89e472eccf7aea6f37eea'

And i came to know that "there is no :git and :commit options in podspec dependency specifier" so if not then how to achieve that thing?

kidsid49
  • 1,358
  • 3
  • 18
  • 37
  • I think the answer involves maintaining a local repository of private podspecs. We have done this in my team, so I'll get back to you on the procedure, if you can't figure it out in the meantime. – Tom Erik Støwer Sep 10 '14 at 07:06
  • check this Answer. It's Really helpful... http://stackoverflow.com/a/27305019/3425873 – paran Jul 08 '15 at 07:33
  • If the above needs more clarity check out the last answer on https://stackoverflow.com/questions/45796986/cocoapods-subspec-issue-none-of-your-spec-sources-contain-a-spec-satisfying-the/72714818#72714818 – AD Progress Jun 22 '22 at 11:42

1 Answers1

16

You have to maintain a repository for your private podspecs.

Add that repository to your CocoaPods installation:

pod repo add MyPrivateSpecs git@git.example.com:MyPrivateSpecs

Add your private dependency pod to it:

pod repo push MyPrivateSpecs Pod1

Now you can simply reference that pod like you normally would:

s.dependency 'Pod1', '~> 0.0.1'
Tom Erik Støwer
  • 1,399
  • 9
  • 19
  • I have that thing the pod spec repo and have added pod1.podspec file there. I am able to add private pod1 into any project by mentioning in podfile. But while providing as a dependency didn't work? – kidsid49 Sep 10 '14 at 07:33
  • That is strange. This is how we have done it in my team, and it definately works. I would need to see more details of the podspecs to help you further. Can you post both? Also, you say it "didn't work". Could you provide more detail as to how exactly it failed? – Tom Erik Støwer Sep 10 '14 at 07:59
  • [!] /usr/bin/git clone https://github.com/MY_COMAPNY/ios-authentication-pod.git /Users/siddarthchaturvedi/Library/Caches/CocoaPods/GitHub/f9abd6ed9ee100de28fe59d35fd5a2e79eaf990e --mirror Cloning into bare repository '/Users/siddarthchaturvedi/Library/Caches/CocoaPods/GitHub/f9abd6ed9ee100de28fe59d35fd5a2e79eaf990e'... remote: Repository not found. fatal: repository 'https://github.com/Codigami/ios-authentication-pod.git/' not found – kidsid49 Sep 10 '14 at 08:57
  • That looks like an authentication problem. What happens if you simply ```git clone https://github.com/Codigami/ios-authentication-pod.git/``` in an empty directory. Does it download? – Tom Erik Støwer Sep 10 '14 at 09:32
  • Got it. Gave SSH address instead of https. – kidsid49 Sep 10 '14 at 10:49
  • I am getting this error ... [!] Error installing EEMyPod [!] Attempt to read non existent folder /Volumes/Development/Work/Projects/Pods/eagle-eye-ios-pod/Example/Pods/EEMyPod. – kidsid49 Nov 11 '14 at 11:05
  • 2
    @Tom, have you see the error: `Unable to find a specification [PrivateSpecName] depended upon by [ClientPrivateSpec]`? I have run pod `remote add MySpecs path/to/my/specs.git` and verified that cocoapods sees it (it appears under `~/.cocoapods/repos/MySpecs`). From my understanding, I have verified that it can see it, but it still complains from within a podspec file, with or without a version. – Chris Conover Dec 04 '14 at 20:14
  • 2
    I believe the second command should now be: `pod repo push MyPrivateSpecs Pod1`. I'm guessing the syntax changed at some point as the linked article also uses `pod push`. – Rob Jones Apr 20 '15 at 22:06