fastlane: fastlane gym produces error: method `to_plist' not defined in Array

New Issue Checklist

Issue Description

On latest version of fastlane, I cannot build anymore build fails, here is the output.

Complete output when running fastlane, including the stack trace and command used
fastlane action gym
[⠼] 🚀 /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/spaceship/lib/spaceship/test_flight/build.rb:87: warning: already initialized constant Spaceship::TestFlight::Build::BUILD_STATES
/Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/spaceship/lib/spaceship/test_flight/build.rb:87: warning: previous definition of BUILD_STATES was here
[✔] 🚀
/Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/credentials_manager/lib/credentials_manager/account_manager.rb:8: warning: already initialized constant CredentialsManager::AccountManager::DEFAULT_PREFIX
/Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/credentials_manager/lib/credentials_manager/account_manager.rb:8: warning: previous definition of DEFAULT_PREFIX was here
Loading documentation for gym:

+----------------------------------------------+
|                     gym                      |
+----------------------------------------------+
| Alias for the `build_ios_app` action         |
|                                              |
| More information: https://fastlane.tools/gym |
|                                              |
| Created by KrauseFx                          |
+----------------------------------------------+


Looking for related GitHub issues on fastlane/fastlane...

Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run `fastlane env` to append the fastlane environment to your issue
/Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane_core/lib/fastlane_core/core_ext/cfpropertylist.rb:16:in `remove_method': [!] method `to_plist' not defined in Array (NameError)
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane_core/lib/fastlane_core/core_ext/cfpropertylist.rb:16:in `block in <top (required)>'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane_core/lib/fastlane_core/core_ext/cfpropertylist.rb:14:in `each'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane_core/lib/fastlane_core/core_ext/cfpropertylist.rb:14:in `<top (required)>'
	from /Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/gym/lib/gym/detect_values.rb:1:in `require'
	from /Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/gym/lib/gym/detect_values.rb:1:in `<top (required)>'
	from /Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/gym/lib/gym/module.rb:3:in `require_relative'
	from /Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/gym/lib/gym/module.rb:3:in `<top (required)>'
	from /Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/gym/lib/gym/manager.rb:2:in `require_relative'
	from /Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/gym/lib/gym/manager.rb:2:in `<top (required)>'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/gym/lib/gym.rb:1:in `require_relative'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/gym/lib/gym.rb:1:in `<top (required)>'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/actions/build_ios_app.rb:105:in `require'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/actions/build_ios_app.rb:105:in `available_options'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/documentation/actions_list.rb:127:in `print_options'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/documentation/actions_list.rb:60:in `show_details'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/documentation/actions_list.rb:6:in `run'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/commands_generator.rb:246:in `block (2 levels) in run'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in `call'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/commander-fastlane-4.4.5/lib/commander/command.rb:153:in `run'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/commander-fastlane-4.4.5/lib/commander/runner.rb:476:in `run_active_command'
	from /Users/user/.rvm/rubies/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.75.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:75:in `run!'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/commander-fastlane-4.4.5/lib/commander/delegates.rb:15:in `run!'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/commands_generator.rb:336:in `run'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/fastlane/lib/fastlane/cli_tools_distributor.rb:94:in `take_off'
	from /Users/user/.rvm/gems/ruby-2.3.3@global/gems/fastlane-2.75.1/bin/fastlane:20:in `<top (required)>'
	from /Users/user/.rvm/gems/ruby-2.3.3/bin/fastlane:22:in `load'
	from /Users/user/.rvm/gems/ruby-2.3.3/bin/fastlane:22:in `<main>'
	from /Users/user/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval'
	from /Users/user/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `<main>'

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.12.6
Ruby 2.3.3
Bundler? true
Git git version 2.14.3 (Apple Git-98)
Installation Source ~/.rvm/gems/ruby-2.3.3/bin/fastlane
Host Mac OS X 10.12.6 (16G1114)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.3.3/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 9.2

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# More information: https://github.com/fastlane/fastlane/tree/master/fastlane/docs
fastlane_version "1.108.0"

ENV["APP_NAME"] = "MyApp"
ENV["INFOPLIST_FILE"] = "MyApp/MyApp-Info.plist"
ENV["SETTINGS_BUNDLE_ROOT"] = "MyApp/Settings.bundle/Root.plist"
ENV["XCODEPROJ"] = "MyApp.xcodeproj"
ENV["WORKSPACE"] = "MyApp.xcworkspace"
ENV["SCHEME_ADHOC"] = "MyApp ADHOC"
ENV["SCHEME_RELEASE"] = "MyApp Release"
ENV["OUTPUT_DIRECTORY"] = "~/Desktop/MyApp"
ENV["TEAM_COMPANY"] = "XXXXXXXXXX"

desc "Called before every lane"
before_all do
    # get the version number
    ENV["VERSION_NUMBER"] = get_version_number(xcodeproj: ENV["XCODEPROJ"])
end

desc "Build a new ipa for dev"
lane :dev do
  build(base_url: "http://<redacted>/api", scheme: ENV["SCHEME_ADHOC"], environment:  "dev")
end

desc "Build a new ipa for qa"
lane :staging do
  build(base_url: "http://<redacted>/api", scheme: ENV["SCHEME_ADHOC"], environment:  "qa")
end

desc "Build a new ipa for training/formation"
lane :training do
  build(base_url: "http://<redacted>/api", scheme: ENV["SCHEME_ADHOC"], environment: "training")
end

desc "Build a new ipa for production"
lane :production do
  build(base_url: "http://<redacted>/api", scheme: ENV["SCHEME_RELEASE"], environment: "production")
end

desc "Build a new ipa whith given options"
private_lane :build do |options|
  # check git status
  #ensure_git_status_clean

  # set base url
  sh("cd .. && /usr/libexec/PlistBuddy \"" + ENV["SETTINGS_BUNDLE_ROOT"] + "\" -c \"set PreferenceSpecifiers:1:DefaultValue " + options[:base_url] + "\"")

  # build the archive and ipa
  output_name_suffix = options[:environment].downcase
  gym(
    workspace: ENV["WORKSPACE"], 
    scheme: options[:scheme], 
    include_bitcode: false, 
    clean: true, 
    silent: false, 
    export_method: "enterprise", 
    export_xcargs: "-allowProvisioningUpdates",
    output_directory: ENV["OUTPUT_DIRECTORY"] + "/" + ENV["VERSION_NUMBER"], # e.g ~/Desktop/MyApp/1.0.0
    output_name: ENV["APP_NAME"] + "-" + ENV["VERSION_NUMBER"] + "-" + output_name_suffix + ".ipa" # e.g. MyApp-1.0.0-production.ipa
  )

  # cleanup
  #reset_git_repo
end

desc "Bump both version numbers"
lane :bump do
  # check git status
  ensure_git_status_clean

  # increment version number
  version = increment_version_number

  # set identical version and build numbers
  set_info_plist_value(path: ENV["INFOPLIST_FILE"], key: "CFBundleVersion", value: version)

  # commit version bump
  git_commit(
    path: [ENV["INFOPLIST_FILE"]], 
    message: "Bump version number"
  )

  # push version bump
  push_to_git_remote()

  # cleanup
  reset_git_repo
end

desc "Build all"
lane :build_all do
	dev
  staging
  training
  production
end

desc "Bump and build all"
lane :bump_build_all do
  bump
  build_all
end

after_all do |lane|
  # display notification
  notification(
    title: ENV["APP_NAME"], 
    subtitle: "Lane '#{lane}' completed successfully!", 
    message: "Grab a beer 🍺"
  )
end

error do |lane, exception|
  # clean
  clean_build_artifacts
  reset_git_repo

  # show how angry you are
  puts "\n(╯°□°)╯︵ ┻━┻\n".red

  # display notification
  notification(
    title: ENV["APP_NAME"], 
    subtitle: "Lane '#{lane}' failed miserably!", 
    message: exception.message
  )
end

`./fastlane/Appfile`
app_identifier "com.company.myapp" # The bundle identifier of your app
apple_id "user@company.com" # Your Apple email address

team_id "XXXXXXXXXX"  # Developer Portal Team ID

# you can even provide different app identifiers, Apple IDs and team names per lane:
# More information: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.0.0
executable-hooks 1.3.2
bundler-unload 1.0.2
rubygems-bundler 1.4.4
bundler 1.16.0
io-console 0.4.5
CFPropertyList 2.3.6
public_suffix 2.0.5
addressable 2.5.2
babosa 1.0.2
claide 1.0.2
colored 1.2
colored2 3.1.2
highline 1.7.10
commander-fastlane 4.4.5
declarative 0.0.10
declarative-option 0.1.0
unf_ext 0.0.7.4
unf 0.1.4
domain_name 0.5.20170404
dotenv 2.2.1
excon 0.60.0
multipart-post 2.0.0
faraday 0.13.1
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
faraday_middleware 0.12.2
fastimage 2.1.1
gh_inspector 1.0.3
jwt 2.1.0
little-plugger 1.1.4
multi_json 1.13.0
logging 2.2.2
memoist 0.16.0
os 0.9.6
signet 0.8.1
googleauth 0.6.2
httpclient 2.8.3
mime-types-data 3.2016.0521
mime-types 3.1
uber 0.1.0
representable 3.0.4
retriable 3.1.1
google-api-client 0.13.6
json 2.1.0
mini_magick 4.5.1
multi_xml 0.6.0
plist 3.4.0
rubyzip 1.2.1
security 0.1.3
slack-notifier 1.5.1
terminal-notifier 1.8.0
unicode-display_width 1.3.0
terminal-table 1.8.0
tty-screen 0.6.4
tty-cursor 0.5.0
tty-spinner 0.7.0
word_wrap 1.0.0
nanaimo 0.2.3
xcodeproj 1.5.4
rouge 2.0.7
xcpretty 0.2.8
xcpretty-travis-formatter 1.0.0

generated on: 2018-01-09

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 9
  • Comments: 28 (2 by maintainers)

Most upvoted comments

Alright, I managed to reproduce this issue by using rvm and installing fastlane with

gem install fastlane

and also

rvm @global do gem install fastlane

Afterwards running rvm @global do fastlane action gym would throw the same error you posted. I fixed it by uninstalling fastlane completely:

rvm @global do gem uninstall fastlane 
rvm all do gem uninstall fastlane
gem uninstall fastlane

And then reinstalling:

gem install fastlane

Afterwards I could use fastlane normally (without the rvm @global do prefix)

Hello @milch,

Thank you for the commands, it worked \o/

$ rvm @global do gem uninstall fastlane

Select gem to uninstall:
 1. fastlane-2.67.0
 2. fastlane-2.71.0
 3. fastlane-2.74.1
 4. fastlane-2.75.1
 5. All versions
> 5
Successfully uninstalled fastlane-2.67.0
Successfully uninstalled fastlane-2.71.0
Successfully uninstalled fastlane-2.74.1
Remove executables:
	bin-proxy, fastlane

in addition to the gem? [Yn]  y
Removing bin-proxy
Removing fastlane
Successfully uninstalled fastlane-2.75.1
$ rvm all do gem uninstall fastlane
$ gem uninstall fastlane
$ gem install fastlane
Fetching: fastlane-2.75.1.gem (100%)
Successfully installed fastlane-2.75.1
Parsing documentation for fastlane-2.75.1
Installing ri documentation for fastlane-2.75.1
Done installing documentation for fastlane after 21 seconds
1 gem installed

Then I ran bundle update in my project folder and now it is working correctly.