Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

NoMethodError - undefined method `target' for nil:NilClass #1168

Closed
risp opened this Issue · 14 comments

6 participants

@risp

Report

  • What did you do?
    Did an update to cocoapods 0.22 and run pod update.

  • What did you expect to happen?
    Normal output, al pods up to date

  • What happened instead?
    See the error message below

Stack

   CocoaPods : 0.22.0
        Ruby : ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
    RubyGems : 2.0.3
        Host : Mac OS X 10.8.4 (12E55)
       Xcode : 5.0 (5A11315e)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 80d65752240b44fe8954b7216a738e9b103851aa

Podfile

platform :ios, '6.0'
pod 'RestKit', '~> 0.20.1'
pod 'MagicalRecord', '~> 2.1'
pod 'LUKeychainAccess', '~> 1.0.1'
pod 'SVPullToRefresh', '~> 0.4.1'
pod 'HexColors', '~> 2.0.0'
pod 'SVProgressHUD', '~> 0.9'
pod 'WCAlertView', '~> 1.0.0'
pod 'JCDefaultFormInputAccessoryView', '~> 0.9.2'
pod 'MPFoldTransition', '~> 0.0.1'
pod 'MLPAutoCompleteTextField', '~> 1.5'
pod 'FlatUIKit', '~> 1.1'
pod 'ViewDeck', '~> 2.2.11'

Error

NoMethodError - undefined method `target' for nil:NilClass
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:366:in `add_dependency'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:343:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:340:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:340:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:338:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:338:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:337:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:337:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:114:in `generate_pods_project'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/user_interface.rb:52:in `section'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:110:in `generate_pods_project'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:88:in `install!'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/command/project.rb:68:in `run'
/Library/Ruby/Gems/1.8/gems/claide-0.3.2/lib/claide/command.rb:206:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/command.rb:50:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/bin/pod:19
/usr/bin/pod:23:in `load'
/usr/bin/pod:23
@scottcc

Got this as well:

Using AFNetworking (1.3.1)
Installing RestKit (0.20.2)
Installing SOCKit (1.1)
Installing TransitionKit (1.1.1)
Generating Pods project

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 0.22.0
        Ruby : ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
    RubyGems : 2.0.3
        Host : Mac OS X 10.8.4 (12E55)
       Xcode : 5.0 (5A11315e)
Ruby lib dir : /usr/local/Cellar/ruby/2.0.0-p0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 80d65752240b44fe8954b7216a738e9b103851aa

Podfile

platform :ios, '6.0'

#pod 'CrittercismSDK', '~>3.5.1'
#pod 'FlurrySDK', '~>4.2.1'
pod 'AFNetworking', '~>1.3.1'
#pod 'SocketRocket', '~>0.2.0'
#pod 'Gummi-Injection', '~>0.5.4'
pod 'RestKit', '~>0.20.0'

Error

NoMethodError - undefined method `target' for nil:NilClass
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:366:in `add_dependency'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:343:in `block (3 levels) in set_target_dependencies'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:340:in `each'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:340:in `block (2 levels) in set_target_dependencies'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:338:in `each'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:338:in `block in set_target_dependencies'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:337:in `each'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:337:in `set_target_dependencies'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:114:in `block in generate_pods_project'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/user_interface.rb:52:in `section'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:110:in `generate_pods_project'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:88:in `install!'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/command/project.rb:68:in `run'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/claide-0.3.2/lib/claide/command.rb:206:in `run'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/lib/cocoapods/command.rb:50:in `run'
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/cocoapods-0.22.0/bin/pod:19:in `<top (required)>'
/usr/local/Cellar/ruby/2.0.0-p0/bin/pod:23:in `load'
/usr/local/Cellar/ruby/2.0.0-p0/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

@vially

It happens to me as well.

Stack (Xcode 4)

   CocoaPods : 0.22.0
        Ruby : ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
    RubyGems : 2.0.3
        Host : Mac OS X 10.8.4 (12E55)
       Xcode : 4.6.3 (4H1503)
Ruby lib dir : /Users/vially/.rvm/rubies/ruby-2.0.0-p195/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 80d65752240b44fe8954b7216a738e9b103851aa

Stack (Xcode 5)

   CocoaPods : 0.22.0
        Ruby : ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
    RubyGems : 2.0.3
        Host : Mac OS X 10.8.4 (12E55)
       Xcode : 5.0 (5A11315e)
Ruby lib dir : /Users/vially/.rvm/rubies/ruby-2.0.0-p195/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 80d65752240b44fe8954b7216a738e9b103851aa
@scottcc

Also, using xcode-switch to move back to Xcode 4.6.3 still shows the same error.

@ghost

This is happening to me as well:

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 0.22.0
        Ruby : ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
    RubyGems : 1.3.6
        Host : Mac OS X 10.8.2 (12C60)
       Xcode : 4.6.3 (4H1503)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 80d65752240b44fe8954b7216a738e9b103851aa

Podfile

platform :ios, '5.0'

pod 'AFNetworking', '~> 1.1.0'
pod 'MagicalRecord', '~> 2.1'
pod 'Mixpanel', '~> 1.1.1'
pod 'TestFlightSDK', '~> 1.3.0.beta'
pod 'TestFlightLogger', '~> 0.0.1'
pod 'SVProgressHUD', '~> 0.9'
pod 'Facebook-iOS-SDK', '~> 3.2.0'
pod 'CocoaLumberjack', '~> 1.6'
pod 'PSTCollectionView', '~> 0.0.1'
pod 'SVPullToRefresh', '~> 0.4.1'
pod 'DTCoreText', '1.5.1'
pod 'SVWebViewController', '~> 0.1'
pod 'Base64', '~> 1.0.1'
pod 'REActivityViewController', '~> 1.6.2'
target :KiwiUnitTest, :exclusive => true do
    pod 'Kiwi'
    pod 'CocoaLumberjack', '~> 1.6'
    pod 'AFNetworking', '~> 1.1.0'
    pod 'MagicalRecord', '~> 2.1'
    pod 'Nocilla', '~> 0.3'
end

generate_bridge_support!

Error

NoMethodError - undefined method `target' for nil:NilClass
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:366:in `add_dependency'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:343:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:340:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:340:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:338:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:338:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:337:in `each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:337:in `set_target_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:114:in `generate_pods_project'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/user_interface.rb:52:in `section'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:110:in `generate_pods_project'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/installer.rb:88:in `install!'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/command/project.rb:68:in `run'
/Library/Ruby/Gems/1.8/gems/claide-0.3.2/lib/claide/command.rb:206:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/lib/cocoapods/command.rb:50:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.22.0/bin/pod:19
/usr/bin/pod:19:in `load'
/usr/bin/pod:19
@fabiopelosin
Owner

Thanks for the reports... I'm having a look at it right now.

@scottcc

If it helps, when I remove pod 'RestKit', '~>0.20.0' from my Podfile, it works, so something common in the pods used by @bartjochems, @gianfrancoinfinix and I are causing it.

@fabiopelosin
Owner

@scottcc exactly, the issue is related to subspecs.

@tdegrunt

I had this same error, the following may be related?

I have ZBarSDK included in my project. (pod 'ZBarSDK', '~> 1.3.1')
After upgrading I received >20 errors on compiling the ZBarSDK project. It seems frameworks are missing from the Pod targets? Only Foundation.framework is in the target build settings, whereas all others were missing.

Downgrading to cocoapods 0.20.2 fixes it for me.

@scottcc

+1 @tdegrunt. Thanks. Downgrading Cocoapods to 0.20.2 also worked for me too.

@scottcc

Awesome! Thanks @irrationalfab.

@fabiopelosin
Owner

@tdegrunt your error doesn't appear to be related.
@scottcc :beers:

@fabiopelosin
Owner

0.22.1 is out which should solve the issue.

@ghost

Wow that was fast :+1: Thanks!

@luisdelarosa

0.22.1 fixed this issue for me which was happening with the OctoKit spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.