Cocoapods: Unable to find a specification for X depended upon by Y) during validation

Created on 16 Feb 2016  路  7Comments  路  Source: CocoaPods/CocoaPods

Here is the case...
I have a pod, which depends on two pods:

  1. Some public pod located at github and not published at cocoapods yet
  2. A pod from cocoapods

Pod file contains two definitions:

pod 'SomeLib', :git => 'https://github.com/SomeLib/SomeLib.git'
pod 'SomeLib2', '~> 3.0'

and it works fine. But in case of .podspec it's not so trivial, since it accepts only cocoapods-published definitions so I can't specify github repo. As a result, I get two errors:

  1. Encountered an unknown error (Unable to find a specification for SomeLib depended upon by MyLib) during validation
  2. fatal: Remote branch 1.0.0-SNAPSHOT not found in upstream origin and I really don't know why it tries to use this branch and not master...

I found this issue, but --sources doesn't help since it still has error # 1

Most helpful comment

in my case, it got solved by including the source URL of the library at the first line of pod file

source 'https://github.com/myrepo.git'

All 7 comments

The --sources option is for specifying additional spec repos, not for specifying a Pod repo. So if you are passing https://github.com/SomeLib/SomeLib.git in your case that will not work.

@neonichu Yes, I tried to use it with pod spec lint but it didn't help as I described

As I said, this is not the use case for --sources that's why you're receiving an error. You'll need to either set up a private spec repo (see https://guides.cocoapods.org/making/private-cocoapods.html) or publish your dependencies on trunk. There's no third option.

I also met this error, and the Thirdlib which is not private spec repo.

pod spec lint --verbose
Resolving dependencies of
-> Mylib (0.1.0)
- ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for Thirdlib depended upon by Thirdlib

/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/resolver.rb:442:in handle_resolver_error' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/resolver.rb:65:inrescue in resolve'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/resolver.rb:57:in resolve' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:719:inblock in resolve_dependencies'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:64:in section' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:717:inresolve_dependencies'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:76:in analyze' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:236:inanalyze'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:150:in block in resolve_dependencies' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:64:insection'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:149:in resolve_dependencies' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/validator.rb:405:inblock in download_pod'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/validator.rb:405:in each' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/validator.rb:405:indownload_pod'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/validator.rb:301:in block in perform_extensive_analysis' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/validator.rb:295:ineach'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/validator.rb:295:in perform_extensive_analysis' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/validator.rb:79:invalidate'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/command/spec/lint.rb:64:in block in run' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/command/spec/lint.rb:53:ineach'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/command/spec/lint.rb:53:in run' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/claide-1.0.1/lib/claide/command.rb:334:inrun'
/Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/lib/cocoapods/command.rb:52:in run' /Users/tony/.rvm/gems/ruby-2.2.2@global/gems/cocoapods-1.2.0/bin/pod:55:in /Users/tony/.rvm/gems/ruby-2.2.2/bin/pod:22:in load' /Users/tony/.rvm/gems/ruby-2.2.2/bin/pod:22:in

'
/Users/tony/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in eval' /Users/tony/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in
'
) during validation.

Analyzed 1 podspec.

@yangshengtao Have there been any solutions with this? i'm currently also struggling with this

@EMart86 I have this issue too.....

in my case, it got solved by including the source URL of the library at the first line of pod file

source 'https://github.com/myrepo.git'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

steffendsommer picture steffendsommer  路  3Comments

evermeer picture evermeer  路  3Comments

soleares picture soleares  路  3Comments

Mingmingmew picture Mingmingmew  路  3Comments

k06a picture k06a  路  3Comments