0

I have a problem resolving third-party dependencies when I use the project path in Podfile.

For example, if I have a pod named TestingPod and in the TestingPod.podspec I have defined dependencies to another pod. For example ChildPod.

The TestingPod.podspec would look like:

spec.dependency 'ChildPod', '0.1'

And my application would have a Podfile:

target 'Test App' do
  use_frameworks!
  
  # Pods for Test App
  pod 'TestingPod', :path => 'path/to/TestingPod.podspec'
end

This way when I try to call pod install I get an error:

Unable to find a specification for `ChildPod(= 0.1)` depended upon by `TestingPod`

The thing that resolves the problem is to add manually dependency in Podfile:

target 'Test App' do
  use_frameworks!
  
  # Pods for Test App
  pod 'TestingPod', :path => 'path/to/TestingPod.podspec'
  pod 'ChildPod', :path => 'path/to/ChildPod.podspec'
end

But then I'm not sure what is the point of setting dependency in the TestingPod.podspec if I have manually to add the dependency in the Podfile?

Thanks in advance

  • 1
    It's because dependencies can't be local it seems. You can see https://stackoverflow.com/questions/46052798/is-it-possible-to-add-a-local-dependency-to-podspec-file https://stackoverflow.com/questions/32581986/cocoa-podspec-and-path-for-dependency and other linked questions in comments/answers Some are old, but I don't think this has changed. There are some other workaround – Larme Dec 09 '21 at 15:47
  • Thanks @Larme for the comment and the links! – Dragan Markovic Dec 10 '21 at 09:22

0 Answers0