New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError - undefined method `add_dependency' for nil:NilClass #1720

Closed
neoneye opened this Issue Dec 28, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@neoneye

neoneye commented Dec 28, 2013

Report

  • What did you do?
    I'm creating 2 cocoapods. Where the first depends on the second. None of them are fully working yet. None of them passes pod spec lint yet.
  • What did you expect to happen?
    Since none of my cocoapods are done yet, I didn't expect it to go well. I would have expected an error message that says "something is wrong with the cocoapod that you depend on".
  • What happened instead?
    Cocoapods crashed without any clues to how to fix it.

Stack

   CocoaPods : 0.29.0
        Ruby : ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
    RubyGems : 2.0.3
        Host : Mac OS X 10.9.1 (13B42)
       Xcode : 5.0.2 (5A3005)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 1bf55e81b1fca597c2851057da58a300df610200

Podfile

xcodeproj "../NCWorker"

pod "newton-commander-browse", :path => "../newton-commander-browse.podspec"
pod 'newton-commander-quark', :git => "https://github.com/neoneye/newton-commander-quark.git"

target "Demo" do
end

#target "DemoTests" do
#end

Error

NoMethodError - undefined method `add_dependency' for nil:NilClass
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:364:in `block (2 levels) in set_target_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:363:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:363:in `block in set_target_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:362:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:362:in `set_target_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:114:in `block in generate_pods_project'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/user_interface.rb:52:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:110:in `generate_pods_project'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:88:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command/project.rb:68:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:213:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:24:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
@neoneye

This comment has been minimized.

Show comment
Hide comment
@neoneye

neoneye Dec 29, 2013

I have found a temporary solution.

In the Project/Podfile I moved the pod into the target and cocoapods no longer crashes.

Before

The Project/Podfile before I moved the pod. This crashes.

platform :osx, '10.9'
xcodeproj "NewtonCommanderBrowse"

pod "newton-commander-browse", :path => "../newton-commander-browse.podspec"

target "Demo" do
end

After

The Project/Podfile after I moved the pod. This works.

platform :osx, '10.9'
xcodeproj "NewtonCommanderBrowse"

target "Demo" do
  pod "newton-commander-browse", :path => "../newton-commander-browse.podspec"
end

neoneye commented Dec 29, 2013

I have found a temporary solution.

In the Project/Podfile I moved the pod into the target and cocoapods no longer crashes.

Before

The Project/Podfile before I moved the pod. This crashes.

platform :osx, '10.9'
xcodeproj "NewtonCommanderBrowse"

pod "newton-commander-browse", :path => "../newton-commander-browse.podspec"

target "Demo" do
end

After

The Project/Podfile after I moved the pod. This works.

platform :osx, '10.9'
xcodeproj "NewtonCommanderBrowse"

target "Demo" do
  pod "newton-commander-browse", :path => "../newton-commander-browse.podspec"
end
@DivineDominion

This comment has been minimized.

Show comment
Hide comment
@DivineDominion

DivineDominion Feb 15, 2014

Same here. Without explicit targets, it works as well.

Also, #1208 does the trick: remove empty target dependency lists.

Same here. Without explicit targets, it works as well.

Also, #1208 does the trick: remove empty target dependency lists.

@kylef

This comment has been minimized.

Show comment
Hide comment
@kylef

kylef Mar 11, 2014

Contributor

This is a duplicate of #1830 so i'm going to close.

Contributor

kylef commented Mar 11, 2014

This is a duplicate of #1830 so i'm going to close.

@kylef kylef closed this Mar 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment