fastlane: Upload to play store error - NoMethodError: [!] undefined method `each_with_index' for nil:NilClass

New Issue Checklist

Issue Description

Good evening!

I’m trying to send one. aab for the track alpha. However, when I try to send the file to the play store, through the “upload_to_play_store” it returns an error in ruby. Just yesterday I sent a version and today the lane didn’t work anymore.

Attachments: image

image

image

image

Best Regards!

Command executed

upload_to_play_store

Complete output when running fastlane, including the stack trace and command used

See more
bundler: failed to load command: fastlane (/Users/vagrant/.rbenv/versions/2.6.5/bin/fastlane)
NoMethodError: [!] undefined method `each_with_index' for nil:NilClass
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/serializer.rb:44:in `block in <module:Representable>'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:39:in `block in call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `each'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `each_with_index'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:38:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/representable-3.0.4/lib/representable/json.rb:44:in `to_json'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/google-apis-core-0.3.0/lib/google/apis/core/api_command.rb:81:in `prepare!'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/google-apis-core-0.3.0/lib/google/apis/core/http_command.rb:99:in `execute'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/google-apis-core-0.3.0/lib/google/apis/core/base_service.rb:377:in `execute_or_queue_command'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/google-api-client-0.38.0/generated/google/apis/androidpublisher_v3/service.rb:1540:in `update_edit_track'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/supply/lib/supply/client.rb:389:in `block in update_track'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/supply/lib/supply/client.rb:81:in `call_google_api'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/supply/lib/supply/client.rb:388:in `update_track'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/supply/lib/supply/uploader.rb:412:in `update_track'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/supply/lib/supply/uploader.rb:22:in `perform_upload'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/actions/upload_to_play_store.rb:33:in `run'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
  Fastfile:34:in `block (2 levels) in parsing_binding'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/lane.rb:33:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
  /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fastlane-2.176.0/bin/fastlane:23:in `<top (required)>'
  /Users/vagrant/.rbenv/versions/2.6.5/bin/fastlane:23:in `load'
  /Users/vagrant/.rbenv/versions/2.6.5/bin/fastlane:23:in `<top (required)>'

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 11.2.2
Ruby 2.6.3
Bundler? false
Git git version 2.24.3 (Apple Git-128)
Installation Source /usr/local/bin/fastlane
Host macOS 11.2.2 (20D80)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 12.4

System Locale

Variable Value
LANG pt_BR.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
default_platform(:android)

platform :android do
   desc 'Push a new build to Play Store as Beta'
  lane :beta do
    download_from_play_store(
      package_name: ENV['PACKAGE_NAME'],
    )

    upload_to_play_store(
      package_name: ENV['SUPPLY_PACKAGE_NAME'],
      track: 'alpha',
      aab: ENV['BITRISE_AAB_PATH'],
      metadata_path: "./fastlane/metadata/android"
    )
  end

end
`./fastlane/Appfile`

fastlane gems

Gem Version Update-Status
fastlane 2.178.0 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.3.0
slack-notifier 2.3.2
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.7.0
terminal-table 1.8.0
public_suffix 4.0.6
addressable 2.7.0
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.7
faraday_middleware 1.0.0
gh_inspector 1.1.3
rubyzip 2.3.0
security 0.1.3
dotenv 2.7.6
bundler 2.1.4
simctl 1.6.8
jwt 2.2.2
uber 0.1.0
declarative 0.0.20
representable 3.0.4
retriable 3.1.2
mini_mime 1.0.2
httpclient 2.8.3
google-api-client 0.38.0
nanaimo 0.3.0
colored2 3.1.2
claide 1.0.3
CFPropertyList 3.0.3
atomos 0.1.3
xcodeproj 1.19.0
plist 3.6.0
babosa 1.0.4
excon 0.79.0
ruby2_keywords 0.0.4
faraday-net_http 1.0.1
faraday 1.3.0
fastimage 2.2.3
json 2.5.1
mini_magick 4.11.0
naturally 2.2.1
xcpretty-travis-formatter 1.0.1
declarative-option 0.1.1
multi_json 1.15.0
signet 0.15.0
os 1.1.1
memoist 0.16.2
googleauth 0.16.0
rake 13.0.3
digest-crc 0.6.3
webrick 1.7.0
rexml 3.2.4
google-apis-core 0.3.0
google-apis-storage_v1 0.3.0
google-apis-iamcredentials_v1 0.2.0
google-cloud-errors 1.1.0
google-cloud-env 1.5.0
google-cloud-core 1.6.0
google-cloud-storage 1.31.0
emoji_regex 3.2.2
aws-eventstream 1.1.1
aws-sigv4 1.2.3
aws-partitions 1.433.0
jmespath 1.4.0
aws-sdk-core 3.113.0
aws-sdk-kms 1.43.0
aws-sdk-s3 1.91.0
forwardable 1.2.0
logger 1.3.0
date 2.0.0
stringio 0.0.2
zlib 1.0.0
ipaddr 1.2.2
openssl 2.1.2
ostruct 0.1.0
strscan 1.0.0
fileutils 1.1.0
etc 1.0.1
io-console 0.4.7
libxml-ruby 3.1.0
psych 3.1.0
mutex_m 0.1.0

generated on: 2021-03-16

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 27
  • Comments: 57 (1 by maintainers)

Most upvoted comments

I have found the culprit.

I have been looking at dependencies updated today, and since everything seemed to revolve around representable, I discovered that declarative-option had an update today from 0.1.0 to 0.1.1.

I am guessing that those who experience this does not use a Gemfile.lock and possibly not a Gemfile.

The solution is to create a Gemfile with the following content:

source "https://rubygems.org"

gem "fastlane"

Install with the following commands:

$ gem install bundler
$ bundle install

Then open Gemfile.lock and change declarative-option (0.1.1) to declarative-option (0.1.0) and run bundle install again.

It should be obvious, but: Add Gemfile.lock to your repository so installation is just the above two commands henceforth.

The solution listed above did not work for me as I already had a Gemfile.lock - however on re running my CI pipeline this morning with no changes, it successfully uploaded to the play store without issue.

Hi @AlexHooperDev, Try to add in Gemfile the content:

source "https://rubygems.org"

gem "declarative-option", "0.1.0"
gem "fastlane", "2.177.0"

It worked for me as a workaround.

@MoOx You need to delete the locally installed gem from your machine as well by running gem uninstall declarative-option --version 0.1.1

But I am getting this error now image

@nbaryshev we ran into this same issue just a little bit ago, and we had to log into the google developer console and let google know that our app was not a news app (they are preventing releases until they have this knowledge). There should be an alert once you are logged into the google play console. Once we resolved that, our release worked! I hope this helps.

@galalmounir Thank you!!!

So my final solution was:

  1. switching back to Fastlane version 2.177
  2. then changing declarative-option from 0.1.1 to 0.1.0

Update: The faulty version has been removed and they are working on a fix. See https://github.com/apotonick/declarative-option/issues/6#issuecomment-801098877.

I’m also experiencing this issue 😦

I also get this when I try to bundle exec fastlane supply --aab build_output/release/app-release.aab --track internal.

This has been driving me crazy, as it was working earlier.

The solution listed above did not work for me as I already had a Gemfile.lock - however on re running my CI pipeline this morning with no changes, it successfully uploaded to the play store without issue.

Hi @AlexHooperDev, Try to add in Gemfile the content:

source "https://rubygems.org"

gem "declarative-option", "0.1.0"
gem "fastlane", "2.177.0"

It worked for me as a workaround.

I tried this earlier this morning, and it worked for me. Specifically adding the declarative-option package at the right version did the trick. I had a Gemfile.lock before as well, and until I specifically set the version for declarative-option, it seemed to keep locking 0.1.1.

Version locking fastlane and declarative-option worked for my case.

@galalmounir how did you force it to turn back to 2.177? I changed the version in my Gemfile and Gemfile.lock

source ‘https://rubygems.org

gem ‘fastlane’, ‘= 2.177’

Then I did bundle install. It said that fastlane 2.177 was installed. But when I run my lane it still uses 2.178

I deleted the Gemfile.lock and change the fastlane version in the Gemfile to 2.177.0. Then ran bundle install. I would say when running your lane, make sure you are running the correct fastlane version. Are you using fastlane directly or bundle exec fastlane?

Using declarative-option 0.1.1 Using fastlane 2.178.0

Hi, @galalmounir

Did you run the bundle installcommand in the Gemfile’s path and removed the Gemfile.lock file?

@galalmounir your output states that you get declarative-option version 0.1.1 and you need to force version 0.1.0. If you didn’t already make a Gemfile.lock, read my comment above on how to.

It happened to me after updating fastlane to the latest: Installing fastlane 2.178.0 (was 2.177.0) I could upload to the internal lane 15 minutes ago with version 2.177.0, I cannot any more with version 2.178.0