Cocoapods: Pod install returning error

Created on 15 Dec 2014  ยท  7Comments  ยท  Source: CocoaPods/CocoaPods

Hi everyone,

I'm new to iOS programming and I wanted to use the _Mutual Mobile Drawer Controller_ for a test application. Unfortunately I have the following error showing up. Juste to make sure I tried to remove the MMDrawer dependency but that did not change anything.
I searched on the issues already encountered but there was not any explanation, just some bug fix commits.

If you need any other info just ask.

Thank you for your support.

Report

  • What did you do?

Running "pod install" command.

  • What did you expect to happen?

Download the dependencies described by my Podfile.

  • What happened instead?

The following error occurred: _NoMethodError - undefined method `downcase' for nil:NilClass_.

Stack

   CocoaPods : 0.35.0
        Ruby : ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
    RubyGems : 2.4.3
        Host : Mac OS X 10.8.5 (12F45)
       Xcode : 5.1.1 (5B1008)
         Git : git version 1.7.12.4 (Apple Git-37)
Ruby lib dir : ~/.rvm/rubies/ruby-2.1.5/lib
Repositories : master -  @ fatal: Not a git repository (or any of the parent directories): .git

Plugins

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

Podfile

source 'https://github.com/CocoaPods/Specs.git'
pod 'AFNetworking', '~> 2.0'
pod 'MMDrawerController', '~> 0.5.7'

Error

NoMethodError - undefined method `downcase' for nil:NilClass
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:396:in `block in source_with_url'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:396:in `each'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:396:in `find'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:396:in `source_with_url'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:37:in `find_or_create_source_with_url'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer/analyzer.rb:435:in `block in sources'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer/analyzer.rb:434:in `map'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer/analyzer.rb:434:in `sources'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer/analyzer.rb:171:in `block in update_repositories_if_needed'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer/analyzer.rb:170:in `update_repositories_if_needed'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer/analyzer.rb:50:in `analyze'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:184:in `analyze'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:106:in `block in resolve_dependencies'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:105:in `resolve_dependencies'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:90:in `install!'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/command/project.rb:101:in `run'
~/.rvm/gems/ruby-2.1.5@global/gems/claide-0.7.0/lib/claide/command.rb:271:in `run'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
~/.rvm/gems/ruby-2.1.5@global/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
~/.rvm/rubies/ruby-2.1.5/bin/pod:23:in `load'
~/.rvm/rubies/ruby-2.1.5/bin/pod:23:in `<main>'
~/.rvm/gems/ruby-2.1.5@global/bin/ruby_executable_hooks:15:in `eval'
~/.rvm/gems/ruby-2.1.5@global/bin/ruby_executable_hooks:15:in `<main>'

Most helpful comment

Command "pod update" might help...

All 7 comments

There's something wrong with your checkout of the master repo:

Repositories : master -  @ fatal: Not a git repository (or any of the parent directories): .git

You should be able to repair this by doing:

$ sudo rm -fr ~/.cocoapods/repos/master
$ pod setup

I tried what you said but each time I'm trying to do a pod setup I have the following error:

[!] /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1

Cloning into 'master'...
error: Could not resolve host: (nil); nodename nor servname provided, or not known while accessing https://github.com/CocoaPods/Specs.git/info/refs?service=git-upload-pack

fatal: HTTP request failed

Knowing that I tried to download manually the Specs but I probably miss something since I have the same error as previously described when opening this issue.

There seems to be some kind of network problem going around on your side. Better take it to Stack Overflow, as this is not really a CP issue.

this is my flutter app
I run the "flutter run" then...

Launching lib/main.dart on iPhone Xส€ in debug mode...
Running pod install... 3.3s
CocoaPods' output:
โ†ณ
Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Finding Podfile changes
  R share_extend
  M Flutter
  - city_pickers
  - fluttertoast
  - image_picker
  - local_auth
  - path_provider
  - screen
  - shared_preferences
  - tobias
  - url_launcher
  - video_player
  - webview_flutter

Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `city_pickers` from `.symlinks/plugins/city_pickers/ios`
-> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
-> Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`
-> Fetching podspec for `local_auth` from `.symlinks/plugins/local_auth/ios`
-> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
-> Fetching podspec for `screen` from `.symlinks/plugins/screen/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `tobias` from `.symlinks/plugins/tobias/ios`
-> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
-> Fetching podspec for `video_player` from `.symlinks/plugins/video_player/ios`
-> Fetching podspec for `webview_flutter` from `.symlinks/plugins/webview_flutter/ios`

Resolving dependencies of `Podfile`

โ€•โ€•โ€• MARKDOWN TEMPLATE โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•

### Command

```
/usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod install --verbose
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.6.1
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.3 (18D42)
       Xcode : 10.3 (10G8)
         Git : git version 2.20.1 (Apple Git-117)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @
fa40c3663865a308f86d49a5ca75baf88940fc2a
```

### Plugins

```
cocoapods-deintegrate : 1.0.3
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.3.1
cocoapods-try         : 1.1.0
```

### Podfile

```ruby
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter
    pub get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new
Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end
```

### Error

```
Pod::StandardError - [Bug] Failed to find known source with the URL "trunk"
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-core-1.6.1/lib/cocoapods-core/source/manage
r.rb:38:in `aggregate_for_dependency'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:402:in
`aggregate_for_dependency'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:392:in
`create_set_from_sources'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:361:in
`find_cached_set'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:335:in
`specifications_for_dependency'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:142:in
`search_for'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:251:in
`block in sort_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:244:in
`each'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:244:in
`sort_by'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:244:in
`sort_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/delegates/specification
_provider.rb:53:in `block in sort_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/delegates/specification
_provider.rb:70:in `with_no_such_dependency_error_handling'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/delegates/specification
_provider.rb:52:in `sort_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:754:in
`push_state_for_requirements'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:746:in
`require_nested_dependencies_for'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:729:in
`activate_new_spec'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:686:in
`attempt_to_activate'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in
`process_topmost_state'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in
`resolve'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in
`resolve'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:91:in
`resolve'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:9
09:in `block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in
`section'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:9
07:in `resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:1
14:in `analyze'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:266:in
`analyze'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:174:in
`block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in
`section'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:173:in
`resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:136:in
`install!'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48:i
n `run'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
/usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `load'
/usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `<main>'
```

โ€•โ€•โ€• TEMPLATE END โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%5BBug%5D+Failed+to+find+known+source+with+the+URL+%
22trunk%22&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - Pod install returning error
   https://github.com/CocoaPods/CocoaPods/issues/2944 [closed] [3 comments]
   15 Dec 2014

Error output from CocoaPods:
โ†ณ
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfi
g.rb:215: warning: Insecure world writable dir /Users/dwh/Desktop in PATH, mode 040777
[!] The version of CocoaPods used to generate the lockfile (1.8.4) is higher than the version of the
current executable (1.6.1). Incompatibility issues may arise.

[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform
was specified. Please specify a platform for this target in your Podfile. See
`https://guides.cocoapods.org/syntax/podfile.html#platform`.

Error running pod install
Error launching application on iPhone Xส€.

Command "pod update" might help...

Delete pods folder & podfile.lock file.
Reinstall pods.

This solved my problem.

In my case, it was not possible to delete Podfile.lock, because I cannot update the pod libs.

Updating Ruby and Cocoapods resolved the issue.

Was this page helpful?
0 / 5 - 0 ratings