fastlane: Deliver Error: undefined method `[]=' for nil:NilClass in spaceship/tunes/language_item.rb

New Issue Checklist

Issue Description

Previously working live build no longer works.

The main problem seems to be deliver fails, but the subsequent slack lane still runs (sending the “success” message), but there is no binary in itunes. There is an error in the log: ERROR [2017-04-20 14:01:52.88]: undefined method `[]=’ for nil:NilClass but it’s hard to see what it is in reference to.

Also, the ipa does not get uploaded to hockeyapp, there is a log message: INFO [2017-04-20 14:01:01.83]: ▸ Unable to find application named ‘HockeyApp’ I don’t recall having to install a hockeyapp app…

Also I see: INFO [2017-04-20 14:30:46.91]: $ security set-key-partition-list -S apple-tool:,apple: -k “” /Users/Shared/Jenkins/Library/Keychains/login.keychain-db security: SecKeychainItemSetAccessWithPassword: The user name or passphrase you entered is not correct. But I am pretty sure nothing has changed there…

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

attached, as it is large fastlane.txt

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.12.4
Ruby 2.3.1
Bundler? false
Git git version 2.11.0 (Apple Git-81)
Installation Source /usr/local/bin/fastlane
Host Mac OS X 10.12.4 (16E195)
Ruby Lib Dir /usr/local/Cellar/ruby/2.3.1_2/lib
OpenSSL Version OpenSSL 1.0.2j 26 Sep 2016
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 8.3

System Locale

Variable Value
LANG en_AU.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
fastlane_require "spaceship"

fastlane_version "2.0.3"

default_platform :ios

environments = [ "HC", "biyi", "detectahotel", "roomguru", "AR", "HE" ]

platform :ios do

  before_all do
    ENV["SLACK_URL"] = "https://hooks.slack.com/services/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"
  end

  private_lane :require_env do
    if(!ENV["app_identifier"])
      puts "No ENViroment"
      exit
    end
  end

  private_lane :setup_options_beta do |options|
    options[:env] = "beta"
    setup_options options
  end

  private_lane :setup_options_live do |options|
    options[:env] = "live"
    setup_options options
  end

  private_lane :setup_options do |options|
    require_env
    env = options[:env]
    options[:match_type] = (env == "live" ? "appstore" : "adhoc")
    options[:match_readonly] = !(options[:create_profile])
    options[:notifications_app_identifier] = ENV['app_identifier'] + (env == "live" ? "" : '.beta') + '.Notifications'
    options[:do_deploy] = !(options[:create_profile])
    options[:gym_scheme] = ENV["gym_scheme_prefix"] + (env == "live" ? " AppStore" : " Beta")
    options[:gym_output_name] = options[:output_name] ? options[:output_name] : options[:gym_scheme]
    options[:hockey_api_token] = ENV["hockey_api_token_" + env]
    options[:hockey_ipa] = options[:gym_output_name] + ".ipa"
    Dir.chdir("..") do
      options[:app_version] = sh "./scripts/getCFBundleShortVersionString.sh | tr -d '\n'"
      options[:app_build] = sh "./scripts/getCFBundleVersion.sh | tr -d '\n'"
    end
  end

  lane :test do |options|
    setup_options_beta options

    match(type: "appstore", readonly: !(options[:create_profile]))
    match(type: options[:match_type], app_identifier: options[:notifications_app_identifier], readonly: options[:match_readonly])
    if(!(options[:create_profile]))
      ipa = gym(scheme: "HCWeb TestFlight", output_name: options[:gym_output_name], export_method: "app-store")
      pilot(ipa: ipa)
      slack_deploy_message options
    end
  end

  lane :beta do |options|
    setup_options_beta options
    
    match(type: options[:match_type], readonly: options[:match_readonly])
    match(type: options[:match_type], app_identifier: options[:notifications_app_identifier], readonly: options[:match_readonly])
    if(options[:do_deploy])
      gym(scheme: options[:gym_scheme], output_name: options[:gym_output_name], export_method: "ad-hoc")
      hockey(api_token: options[:hockey_api_token], ipa: options[:hockey_ipa])
      slack_deploy_message options
    end
  end

  lane :preview_all do |options|
    for env in environments do
      Dir.chdir("..") do
        sh "fastlane preview --env " + env
      end
    end
  end

  lane :preview do |options|
    setup_options_live options

    Dir.chdir("..") do
      sh "deliver generate_summary -a " + ENV["app_identifier"]
      sh "mv Preview.html Preview-" + ENV["gym_scheme_prefix"] + ".html"
    end
  end

  lane :live do |options|
    setup_options_live options

    match(type: options[:match_type], readonly: options[:match_readonly])
    match(type: options[:match_type], app_identifier: options[:notifications_app_identifier], readonly: options[:match_readonly])
    if(options[:do_deploy])
      # snapshot
      gym(scheme: options[:gym_scheme], output_name: options[:gym_output_name], export_method: "app-store")
      deliver(app_version: options[:app_version], submit_for_review: !options[:skip_review])
      hockey(api_token: options[:hockey_api_token], ipa: options[:hockey_ipa])
      slack_deploy_message options
    end
  end

  lane :release do |options|
    setup_options_live options
    
    Spaceship::Tunes.login()
    app = Spaceship::Tunes::Application.find(ENV['app_identifier'])
    version = app.edit_version
    if(version)
      if(version.can_send_version_live)
        version.release!
        puts ENV["app_identifier"] + " released"
        slack_release_message options
      else
        puts ENV["app_identifier"] + " not releasable"
      end
    else
      puts ENV["app_identifier"] + " already released"
    end
  end

  lane :release_all do
    for env in environments do
      Dir.chdir("..") do
        sh "fastlane release --env " + env
      end
    end
  end

  lane :upload_screenshots do |options|
    setup_options_live options
    deliver(app_version: options[:app_version], skip_screenshots: false, skip_metadata: true, submit_for_review: false)
  end

  lane :upload_screenshots_all do
    for env in environments do
      Dir.chdir("..") do
        sh "fastlane upload_screenshots --env " + env
      end
    end
  end

  lane :init_match do
    match(type: "development", readonly: true, app_identifier: "com.hotelscombined.findhotels.dev")
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.findhotels.beta)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.findhotels.AR.beta)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.findhotels.HE.beta)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.biyi.beta)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.detectahotel.beta)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.roomguru.beta)

    match(type: "development", readonly: true, app_identifier: "com.hotelscombined.findhotels.dev.Notifications")
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.findhotels.beta.Notifications)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.findhotels.AR.beta.Notifications)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.findhotels.HE.beta.Notifications)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.biyi.beta.Notifications)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.detectahotel.beta.Notifications)
    #match(type: development, readonly: true, app_identifier: com.hotelscombined.roomguru.beta.Notifications)
  end

  private_lane :slack_deploy_message do |options|
    payload = {
      "App Identifier" => ENV["app_identifier"],
      "Version" => options[:app_version],
      "Build" => options[:app_build]
    }
    if(options[:env] == "beta")
      payload["Download"] = ENV["hockey_download_link"]
    end
    slack(
      message: "iOS App successfully deployed.",
      payload: payload
    )
  end

  private_lane :slack_release_message do |options|
    payload = {
      "App Identifier" => ENV["app_identifier"],
      "Version" => options[:app_version],
      "Build" => options[:app_build]
    }
    slack(
      message: "iOS App successfully released.",
      payload: payload
    )
  end

  error do |lane, exception|
    slack(
      message: "iOS App deployment failed.",
      success: false,
      payload: {
        "App Identifier" => ENV["app_identifier"],
        "Exception" => exception.message
      }
    )
  end

end
`./fastlane/Appfile`
apple_id "david.clark@hotelscombined.com"
team_id "SE23A8X5U7"
for_lane :beta do
	app_identifier ENV['app_identifier'] + '.beta'
end
for_lane :live do
	app_identifier ENV['app_identifier']
end
for_lane :test do
	app_identifier ENV['app_identifier']
end
for_lane :upload_screenshots do
	app_identifier ENV['app_identifier']
end

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.0.2
slack-notifier 1.5.1
CFPropertyList 2.3.5
claide 1.0.1
colored2 3.1.2
nanaimo 0.2.3
xcodeproj 1.4.4
rouge 1.11.1
xcpretty 0.2.4
terminal-notifier 1.7.1
terminal-table 1.4.5
plist 3.1.0
addressable 2.3.8
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.5.0
babosa 1.0.2
colored 1.2
highline 1.7.8
commander-fastlane 4.4.4
excon 0.54.0
faraday 0.9.2
unf_ext 0.0.7.2
unf 0.1.4
domain_name 0.5.20160826
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 1.6.8
gh_inspector 1.0.2
uber 0.0.15
representable 2.3.0
retriable 2.1.0
mime-types-data 3.2016.0521
mime-types 3.1
hurley 0.2
little-plugger 1.1.4
multi_json 1.12.1
logging 2.1.0
jwt 1.5.6
memoist 0.15.0
os 0.9.6
signet 0.7.3
googleauth 0.5.1
httpclient 2.8.2.4
google-api-client 0.9.19
mini_magick 4.5.1
multi_xml 0.5.5
rubyzip 1.1.7
security 0.1.3
xcpretty-travis-formatter 0.0.4
dotenv 2.1.1
bundler 1.13.6
faraday_middleware 0.10.0
json 2.0.2
io-console 0.4.6

generated on: 2017-04-20

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23 (5 by maintainers)

Most upvoted comments

This bug is due to inconsistency in keyword conversion table between iTunes Connect and fastlane, so fix it by correcting wrong keywords.

https://github.com/fastlane/fastlane/pull/8925/files

We’re preparing a new release right now, it should be live in about 30 minutes 🚀

Same problem. We run Jenkins on several nodes, so applying https://github.com/fastlane/fastlane/pull/8925/files manually is difficult and error prone, and we are trying to submit to ITC today. Any ETA on a fix? Thanks, awesome tools BTW!!