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

TypeError - no implicit conversion of nil into String #6381

Closed
KarthikGowda022 opened this issue Jan 6, 2017 · 17 comments
Closed

TypeError - no implicit conversion of nil into String #6381

KarthikGowda022 opened this issue Jan 6, 2017 · 17 comments
Assignees
Milestone

Comments

@KarthikGowda022
Copy link

KarthikGowda022 commented Jan 6, 2017

Hi team,

I'm new to cocoapods. I'm trying to create a cocoapods library with pods name 'XXXXXLogging'
Getting the following error when I run 'pod install'

Analyzing dependencies

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

Command

/usr/local/bin/pod install

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 1.1.1
        Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
    RubyGems : 2.0.14.1
        Host : Mac OS X 10.12.2 (16C67)
       Xcode : 8.2.1 (8C1002)
         Git : git version 2.10.1 (Apple Git-78)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : xxxxx-kkkkkkk-xxxxxxxxlogging - https://github.xxxxx.com/kkkkk/xxxxxxxxxLogging.git @ 8d8799e951856b13ef8acd273c58eb0c8162c61c
               master - https://github.com/CocoaPods/Specs.git @ 02330d59dd94cb08b68b83d178daa20b9e05ccbb

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.1.1
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.xxxxxxxx.com/kkkkkk/xxxxxxxxxLogging.git'
platform :ios, '9.0'

target 'xxxxxxLoggingSample' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'xxxxxxxxLogging'

  # Pods for xxxxxxxxLoggingSample

  target 'xxxxxxxxxLoggingSampleTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'xxxxxxxtLoggingSampleUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Error

TypeError - no implicit conversion of nil into String
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification.rb:523:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification.rb:523:in `new'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification.rb:523:in `from_file'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/specification/set.rb:45:in `specification'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/source.rb:265:in `search'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.1.1/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:347:in `create_set_from_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:317:in `find_cached_set'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:290:in `specifications_for_dependency'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:108:in `search_for'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:206:in `block in sort_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:200:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:200:in `sort_by'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:200:in `sort_dependencies'
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.3/lib/molinillo/delegates/specification_provider.rb:52:in `block in sort_dependencies'
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.3/lib/molinillo/delegates/specification_provider.rb:69:in `with_no_such_dependency_error_handling'
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.3/lib/molinillo/delegates/specification_provider.rb:51:in `sort_dependencies'
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.3/lib/molinillo/resolution.rb:165:in `initial_state'
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.3/lib/molinillo/resolution.rb:106:in `start_resolution'
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.3/lib/molinillo/resolution.rb:64:in `resolve'
/Library/Ruby/Gems/2.0.0/gems/molinillo-0.5.3/lib/molinillo/resolver.rb:42:in `resolve'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/resolver.rb:62:in `resolve'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:723:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:721:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:76:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:236:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:149:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:110:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:37:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

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

Please help me in resolving the issue. I have seen multiple solutions posted for issue #5564 #6103 #3333. But none of them worked for me!! Please help.

Podsepc:
Pod::Spec.new do |s|
s.name = 'xxxxxxLogging'
s.version = '0.1.0'
s.summary = 'A short description of xxxxxxLogging.'
s.description = 'TODO:Add long description of the pod here.'
s.homepage = 'https://github.xxxxxxx.com/xxxxxxx/xxxxxxxxxxxxxLogging'
s.license = { :type => 'Proprietary' }
s.author = { 'Gowda, Karthik' => 'Karthik_Gowda@gmail.com' }
s.source = { :git => 'https://github.xxxxxxx.com/xxxxxxx/xxxxxxxxxxxxxLogging.git', :tag => s.version }

s.platform = :ios
s.ios.deployment_target = '8.0'
s.source_files = 'xxxxxxxxLogging/**/*.{swift,h}'
s.public_header_files = 'xxxxxxxLogging/Logging.h'
end

@dnkoutso
Copy link
Contributor

dnkoutso commented Jan 6, 2017

Can you please paste your podspec?

@KarthikGowda022
Copy link
Author

KarthikGowda022 commented Jan 6, 2017

Podspec:

Pod::Spec.new do |s|
s.name = 'xxxxxxLogging'
s.version = '0.1.0'
s.summary = 'A short description of xxxxxxLogging.'
s.description = 'TODO:Add long description of the pod here.'
s.homepage = 'https://github.xxxxxxx.com/xxxxxxx/xxxxxxxxxxxxxLogging'
s.license = { :type => 'Proprietary' }
s.author = { 'Gowda, Karthik' => 'Karthik_Gowda@gmail.com' }
s.source = { :git => 'https://github.xxxxxxx.com/xxxxxxx/xxxxxxxxxxxxxLogging.git', :tag => s.version }

s.platform = :ios
s.ios.deployment_target = '8.0'
s.source_files = 'xxxxxxxxLogging/**/*.{swift,h}'
s.public_header_files = 'xxxxxxxLogging/Logging.h'
end

@dnkoutso
Copy link
Contributor

@KarthikGowda022 its very hard to test this without a sample project. Can you please provide one?

@janmisar
Copy link

janmisar commented Mar 9, 2017

Same error happened to me when we moved pod from private repo to public one. Solved by removing private repo because I don't need it anymore, but it's not the solution of course 😄
Try to clear some caches or something like that maybe..?

@Bobobbb
Copy link

Bobobbb commented Apr 4, 2017

Enter the directory of your.Podspec file
execute:
pod repo push [your private warehouse name] [your.Podspec file]
For example:
pod repo push LocalSpecs LocalSpecs.podspec

@stale stale bot added the s1:awaiting input Waiting for input from the original author label Jul 3, 2017
@stale
Copy link

stale bot commented Jul 3, 2017

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

@itatawy
Copy link

itatawy commented Jul 5, 2017

I'm facing the same problem but your solution didn't work with me still getting the same error podspec is valid if I removed the dependency I updated ruby and removed cocoa-pods and installed it again and did every expected solution people mentioned but still facing the same problem. any clues?
Here is everything about the problem:

I'm creating a private pod depending on another private pod the linter works well when I don't add any dependency but when I add the dependency and run the lint command it gives me that error
Encountered an unknown error (no implicit conversion of nil into String) during validation.
the lint command:
pod spec lint --private --sources=https://github.com/*****/****.git
Here is my podSpec

Pod::Spec.new do |s|

s.name         = "****Framework"
s.version      = "1.0.0"
s.summary      = "Summary  ................."
s.homepage     = "https://github.com/****/****Framework"
s.description  = "Description ................."
s.license      = "Simplified BSD license"
s.author       = { "Nahla Mortada" => "nahla.mortada@****.com" }
s.platform     = :ios, "9.0"
s.ios.deployment_target = "9.0"
s.source   = { :git => "https://github.com/****/****Framework.git", :tag => s.version }
s.source_files = "****Framework/*.swift"
s.pod_target_xcconfig =  {
'SWIFT_VERSION' => '3.0',
}
s.requires_arc = true
s.dependency '****'

end

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Jul 5, 2017
yanzhiwei147 added a commit to yanzhiwei147/Core that referenced this issue Sep 8, 2017
@toddjonker
Copy link

toddjonker commented Sep 21, 2017

I'm encountering the same problem (CocoaPods 1.2.1). The root cause was a private repo that had a directory for the desired pod, but no podspecs within the directory. Removing that directory caused the install to fail with a meaningful error message.

IMO this is a defect in the dependency resolver; it should handle that edge case gracefully and behave as if no revisions of the pod are in the repo.

@orta
Copy link
Member

orta commented Sep 21, 2017

Yep, there's an active PR for this issue: CocoaPods/Core#405 - should be fixed in the next release

@toddjonker
Copy link

Hm, it's not clear that the PR repairs the root cause I've got (no specs in the directory for a Pod), and the unit tests don't seem to cover it either. I'm not at all familiar with this code, but it seems reasonable to have a test case ensuring things work if there's a directory with no podspecs inside. At my quick reading, the code seems to assume that if there's a directory, there's at least one version therein.

@orta
Copy link
Member

orta commented Sep 22, 2017

Ah, sure - fair enough, then you're welcome to take a look at either building on that PR, or making an independent one that covers the case 👍

@stale
Copy link

stale bot commented Dec 21, 2017

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

@stale stale bot added the s1:awaiting input Waiting for input from the original author label Dec 21, 2017
@stale
Copy link

stale bot commented Dec 28, 2017

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

@stale stale bot closed this as completed Dec 28, 2017
@paulb777
Copy link
Member

paulb777 commented Mar 1, 2018

I ran into the empty directory issue described by @toddjonker at #6381 (comment) and it cost me a few hours this week. I'm going to make a PR to fix.

@paulb777 paulb777 reopened this Mar 1, 2018
@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Mar 1, 2018
@dnkoutso
Copy link
Contributor

dnkoutso commented Mar 1, 2018

Thank you @paulb777 !

@GitHubTracey
Copy link

In case someone else comes across this in the future, if you are late to the cocoapods game, make sure you are using ruby > 2.3.1.

@atommicios
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants