Skip to content
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 `native_target' for nil:NilClass #2910

Closed
brightredchilli opened this issue Dec 5, 2014 · 5 comments · Fixed by CocoaPods/Core#231
Closed
Labels
s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!

Comments

@brightredchilli
Copy link

Report

  • What did you do?
    pod install. Along the way, many hopeful signs as indicated by the verbose flag
Activated: BTGraphicsLibrary, Eigen, boost/numeric-includes, boost/preprocessor-includes

Comparing resolved specification to the sandbox manifest
  A BTGraphicsLibrary
  A boost
  A eigen
  • What did you expect to happen?
  • What happened instead?

Got this exception. From what digging I can do, it is being triggered from the last line:

installer.rb

              # TODO remove me
              unless pod_dependency_target
                puts "[BUG] DEP: #{dep}"
              end
              pod_target.native_target.add_dependency(pod_dependency_target.native_target)

Because pod_dependency_target is somehow nil(I get the print out BUG] DEP: Eigen)....but how?

Podfile looks like this:

platform :ios                                                               
pod 'BTGraphicsLibrary', :git => 'git@github.com:xxx/graphics.git', :branch => 'ying/podspec'

The podspec for BTGraphicsLibrary looks like this:

{
  "name": "BTGraphicsLibrary",
  "summary": "...",
  "version": "1.0.0",
  "source": {
    "git": "git@github.com:xxx/graphics.git"
  },
  "platform" : "ios",
  "deployment_target" : {
    "ios" : "7.0"
  },
  "dependencies" : {
    "Eigen" : ["~> 3.2"]
  },

  "source_files" : ["include/**/*", "src/**/*", "glm/**/*"],
  "preserve_paths" : "*",
  "xcconfig" : {
    "USER_HEADER_SEARCH_PATHS" : "$(SRCROOT)/BTGraphicsLibrary"
  }
}

Stack

   CocoaPods : 0.35.0
        Ruby : ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
    RubyGems : 2.2.2
        Host : Mac OS X 10.10 (14A389)
       Xcode : 6.1 (6A1052c)
         Git : git version 1.9.3 (Apple Git-50)
Ruby lib dir : /Users/ying/.rvm/rubies/ruby-2.1.1/lib
Repositories : ip-internal-library - gitlabscm@yyy.com:library/internal-podspecs.git @ d19d49e8232c50ebf5280ce742d6f7c788987b24
               master - https://github.com/CocoaPods/Specs.git @ 9227350ae7605691c8c3833171a14a206175af49

Plugins

cocoapods-plugins : 0.3.1
cocoapods-trunk   : 0.4.1
cocoapods-try     : 0.4.2

Podfile

platform :ios
pod 'BTGraphicsLibrary', :git => 'git@github.com:xxx/graphics.git', :branch => 'ying/podspec'

Error

NoMethodError - undefined method `native_target' for nil:NilClass
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:442:in `block (3 levels) in set_target_dependencies'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:435:in `each'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:435:in `block (2 levels) in set_target_dependencies'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:433:in `each'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:433:in `block in set_target_dependencies'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:431:in `each'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:431:in `set_target_dependencies'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:128:in `block in generate_pods_project'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:124:in `generate_pods_project'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:93:in `install!'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/command/project.rb:101:in `run'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/claide-0.7.0/lib/claide/command.rb:271:in `run'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
/Users/ying/.rvm/gems/ruby-2.1.1/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
/Users/ying/.rvm/gems/ruby-2.1.1/bin/pod:23:in `load'
/Users/ying/.rvm/gems/ruby-2.1.1/bin/pod:23:in `<main>'
/Users/ying/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/ying/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
@brightredchilli
Copy link
Author

More digging - I found out what was wrong.

I have specified the dependency in the podspec as 'Eigen', but the pod is actually 'eigen'. Are cocoapods case sensitive? maybe it should not download the pod in the first place - that would have saved me a bunch of time : ) Either that, or the set_target_dependencies method needs to lowercase everything before comparison.

@segiddins
Copy link
Member

I actually put a fix for this into Core yesterday that should also apply in this case. Keep it open though, we need test coverage for this for sure.

@segiddins segiddins added s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! labels Dec 5, 2014
@vanderneut
Copy link

Thanks brightredchilli -- I had the exact same problem. Fixed by changing 'Cocos2D' to 'cocos2d' in my podspec.

@kylef
Copy link
Contributor

kylef commented Mar 31, 2015

@segiddins seems like this is another cause from CocoaPods/Core#231 ?

@segiddins
Copy link
Member

Yup, looks like it :(

-Samuel E. Giddins

On Mar 30, 2015, at 8:42 PM, Kyle Fuller notifications@github.com wrote:

@segiddins seems like this is another cause from CocoaPods/Core#231 ?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants