fastlane-old / deliver

Upload screenshots, metadata and your app to the App Store using a single command
https://fastlane.tools
2.24k stars 162 forks source link

Error when using download_screenshots: undefined method `count' for nil:NilClass #540

Closed JesseCrocker closed 8 years ago

JesseCrocker commented 8 years ago

Using deliver 1.7.0

[15:09:32]: Downloading all existing screenshots...
[15:09:33]: undefined method `count' for nil:NilClass
[15:09:33]: Couldn't download already existing screenshots from iTunesConnect.

stacktrace:

/usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.19.0/lib/spaceship/tunes/application.rb:103:in `live_version'
/usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.19.0/lib/spaceship/tunes/application.rb:121:in `latest_version'
/usr/local/lib/ruby/gems/2.2.0/gems/deliver-1.7.0/lib/deliver/download_screenshots.rb:14:in `download'
/usr/local/lib/ruby/gems/2.2.0/gems/deliver-1.7.0/lib/deliver/download_screenshots.rb:5:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/deliver-1.7.0/lib/deliver/commands_generator.rb:78:in `block (2 levels) in run'
/usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
/usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
/usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
/usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.5/lib/commander/runner.rb:68:in `run!'
/usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
/usr/local/lib/ruby/gems/2.2.0/gems/deliver-1.7.0/lib/deliver/commands_generator.rb:107:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/deliver-1.7.0/lib/deliver/commands_generator.rb:12:in `start'
/usr/local/lib/ruby/gems/2.2.0/gems/deliver-1.7.0/bin/deliver:5:in `<top (required)>'
/usr/local/bin/deliver:23:in `load'
/usr/local/bin/deliver:23:in `<main>'

The problem seems to be in spaceship/tunes/application.rb in the live_version function, and i fixed it by changing if raw_data['versions'].count == 1 to if raw_data['versions'] && raw_data['versions'].count == 1, but i dont know enough ruby, or have enough familiarity with the code base to know if this is an acceptable fix.

KrauseFx commented 8 years ago

Could you update spaceship using sudo gem update spaceship or bundle update if you use bundler

domhof commented 8 years ago

I got the same error today. sudo gem update spaceship fixed it. Thanks @KrauseFx! :thumbsup:

KrauseFx commented 8 years ago

Thanks everyone :+1:

fastlanebot commented 8 years ago

This issue was migrated to https://github.com/fastlane/fastlane/issues/2126. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo :rocket: