fastlane: can't modify frozen String: "true" for enterprise builds

New Issue Checklist

Issue Description

So my company makes Enterprise, App Store and Ad-Hoc builds and recently all of our enterprise builds stopped working. I’m using the latest version of fastlane(2.142.0).

Command executed

I use the match command in a ruby script: other_action.match( type: type, git_url: myGitUrl, git_branch: fi_name, app_identifier: [bundleID], team_id: team, keychain_name: ENV['KEYCHAIN_NAME'], keychain_password: ENV['KEYCHAIN_PASSWORD'], username: username, force_for_new_devices: true, verbose: true )

Complete output when running fastlane, including the stack trace and command used
 [+----------------------------+--------------------------------------------------------------------------------------------------------------------Summary for match 2.142.0
| type                       | enterprise
| git_url                    | myGitURL
| git_branch                 | myGitBranch 
| app_identifier             | myAppIdentifier                                                                                         |team_id                    | myteamid                                                                                                       
| keychain_name              | mykeychainname                                                                                                
| keychain_password        | mypassword                                                                                                           
| username                   | myusername                                                                                              
| force_for_new_devices      | true                                                                                                               | verbose                    | true                                                                                                               | readonly                   | false                                                                                                              | generate_apple_certs       | true                                                                                                               | skip_provisioning_profiles | false                                                                                                              | storage_mode               | git                                                                                                                | shallow_clone              | false                                                                                                              | clone_branch_directly      | false                                                                                                              | force                      | false                                                                                                              | skip_confirmation          | false                                                                                                              | skip_docs                  | false                                                                                                              | platform                   | ios                                                                                                                

INFO [2020-02-19 21:13:57.68]: Cloning remote git repo… INFO [2020-02-19 21:13:57.68]: If cloning the repo takes too long, you can use the clone_branch_directly option in match. INFO [2020-02-19 21:13:57.68]: $ git clone mybranch INFO [2020-02-19 21:13:57.72]: ▸ Cloning into folder INFO [2020-02-19 21:13:58.29]: ▸ remote: Azure Repos
INFO [2020-02-19 21:13:58.42]: ▸ remote: Found 988 objects to send. (133 ms)
INFO [2020-02-19 21:13:58.65]: ▸ Receiving objects: 100% (988/988), 1.19 MiB | 5.47 MiB/s, done. INFO [2020-02-19 21:13:58.65]: ▸ Resolving deltas: 100% (153/153), done. INFO [2020-02-19 21:13:58.68]: $ git --no-pager branch --list origin/enterprise --no-color -r INFO [2020-02-19 21:13:58.69]: Checking out branch enterprise… INFO [2020-02-19 21:13:58.69]: $ git checkout --orphan enterprise INFO [2020-02-19 21:13:58.71]: ▸ Switched to a new branch ‘enterprise’ INFO [2020-02-19 21:13:58.71]: $ git reset --hard INFO [2020-02-19 21:13:58.72]: 🔓 Successfully decrypted certificates repo INFO [2020-02-19 21:13:58.72]: Verifying that the certificate and profile are still valid on the Dev Portal… /usr/local/lib/ruby/gems/2.7.0/gems/faraday_middleware-0.13.1/lib/faraday_middleware/response_middleware.rb:14: warning: Capturing the given block using Proc.new is deprecated; use &block instead /usr/local/lib/ruby/gems/2.7.0/gems/faraday_middleware-0.13.1/lib/faraday_middleware/response_middleware.rb:14: warning: Capturing the given block using Proc.new is deprecated; use &block instead Reading keychain entry, because either user or password were empty WARN [2020-02-19 21:13:59.54]: Couldn’t find a valid code signing identity for enterprise… creating one for you now

±---------------------±------------------------------------------------------+ | Summary for cert 2.142.0 | ±---------------------±------------------------------------------------------+ | development | false | | generate_apple_certs | true | | force | true | | username | myusername | | team_id | myteamid | | keychain_path | /Users/runner/Library/Keychains/iOS-deathstar-9073-db | | keychain_password | password | | platform | ios | ±---------------------±------------------------------------------------------+

INFO [2020-02-19 21:13:59.55]: Starting login with user myusername Reading keychain entry, because either user or password were empty INFO [2020-02-19 21:14:00.77]: Successfully logged in INFO [2020-02-19 21:14:01.17]: $ security import /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20200219-19584-x8pinj/certs/enterprise/BCFKZWR2RL.p12 -k ‘/Users/runner/Library/Keychains/iOS-deathstar-9073-db’ -P ‘’ -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild INFO [2020-02-19 21:14:01.26]: ▸ 1 key imported. INFO [2020-02-19 21:14:01.27]: Setting key partition list… (this can take a minute if there are a lot of keys installed) INFO [2020-02-19 21:14:01.27]: $ security set-key-partition-list -S apple-tool:,apple: -s -k *** /Users/runner/Library/Keychains/iOS-deathstar-9073-db 1> /dev/null INFO [2020-02-19 21:14:01.32]: $ security import /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20200219-19584-x8pinj/certs/enterprise/BCFKZWR2RL.cer -k ‘/Users/runner/Library/Keychains/iOS-deathstar-9073-db’ -P ‘’ -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild INFO [2020-02-19 21:14:01.38]: ▸ 1 certificate imported. INFO [2020-02-19 21:14:01.39]: Setting key partition list… (this can take a minute if there are a lot of keys installed) INFO [2020-02-19 21:14:01.39]: $ security set-key-partition-list -S apple-tool:,apple: -s -k *** /Users/runner/Library/Keychains/iOS-deathstar-9073-db 1> /dev/null INFO [2020-02-19 21:14:01.45]: Successfully generated BCFKZWR2RL which was imported to the local machine. INFO [2020-02-19 21:14:01.45]: $ security list-keychains -d user INFO [2020-02-19 21:14:01.47]: ▸ “/Users/runner/Library/Keychains/iOS-deathstar-9073-db” INFO [2020-02-19 21:14:01.47]: $ security find-certificate -c ‘Apple Worldwide Developer Relations Certification Authority’ /Users/runner/Library/Keychains/iOS-deathstar-9073-db security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain. INFO [2020-02-19 21:14:01.50]: $ security list-keychains -d user INFO [2020-02-19 21:14:01.51]: ▸ “/Users/runner/Library/Keychains/iOS-deathstar-9073-db” DEBUG [2020-02-19 21:14:01.51]: Installing WWDR Cert: curl -f -o /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/AppleWWDRCA20200219-19584-12to760 https://developer.apple.com/certificationauthority/AppleWWDRCA.cer && security import /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/AppleWWDRCA20200219-19584-12to760 -k /Users/runner/Library/Keychains/iOS-deathstar-9073-db INFO [2020-02-19 21:14:01.66]: ▸ 1 certificate imported. INFO [2020-02-19 21:14:01.66]: ▸ 100 1062 100 1062 0 0 9925 0 --:–:-- --:–:-- --:–:-- 9925 INFO [2020-02-19 21:14:01.98]: Verifying the certificate is properly installed locally… INFO [2020-02-19 21:14:01.98]: Successfully installed certificate BCFKZWR2RL

±------------------------------------±-----------------------------------+ | Summary for sigh 2.142.0 | ±------------------------------------±-----------------------------------+ | app_identifier | my app identifier | | developer_id | false | | development | false | | skip_install | false | | skip_fetch_profiles | false | | skip_certificate_verification | false | | readonly | false | ±------------------------------------±-----------------------------------+

INFO [2020-02-19 21:14:02.06]: Starting login with user username Reading keychain entry, because either user or password were empty INFO [2020-02-19 21:14:02.60]: Successfully logged in INFO [2020-02-19 21:14:02.60]: Fetching profiles… INFO [2020-02-19 21:14:02.80]: Verifying certificates… WARN [2020-02-19 21:14:02.80]: No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you INFO [2020-02-19 21:14:02.95]: $ security list-keychains -d user INFO [2020-02-19 21:14:02.96]: ▸ “/Users/runner/Library/Keychains/iOS-deathstar-9073-db” INFO [2020-02-19 21:14:02.96]: $ security find-certificate -c ‘Apple Worldwide Developer Relations Certification Authority’ /Users/runner/Library/Keychains/iOS-deathstar-9073-db INFO [2020-02-19 21:14:02.99]: ▸ keychain: “/Users/runner/Library/Keychains/iOS-deathstar-9073-db” INFO [2020-02-19 21:14:02.99]: ▸ version: 512 INFO [2020-02-19 21:14:02.99]: ▸ class: 0x80001000 INFO [2020-02-19 21:14:02.99]: ▸ attributes: INFO [2020-02-19 21:14:02.99]: ▸ “alis”<blob>=“Apple Worldwide Developer Relations Certification Authority” INFO [2020-02-19 21:14:02.99]: ▸ “cenc”<uint32>=0x00000003 INFO [2020-02-19 21:14:02.99]: ▸ “ctyp”<uint32>=0x00000001 INFO [2020-02-19 21:14:02.99]: ▸ “hpky”<blob>=0x88271709A9B618608BECEBBAF64759C55254A3B7 “\210’\027\011\251\266\030\213\354\353\272\366GY\305RT\243\267" INFO [2020-02-19 21:14:02.99]: ▸ "issu"<blob>=0x3062310B300906035504061302555331133011060355040A130A4150504C4520494E432E31263024060355040B131D4150504C452043455254494649434154494F4E20415554484F52495459311630140603550403130D4150504C4520524F4F54204341 "0b1\0130\011\006\003U\004\006\023\002US1\0230\021\006\003U\004\012\023\012APPLE INC.1&0$\006\003U\004\013\023\035APPLE CERTIFICATION AUTHORITY1\0260\024\006\003U\004\003\023\015APPLE ROOT CA" INFO [2020-02-19 21:14:02.99]: ▸ "labl"<blob>="Apple Worldwide Developer Relations Certification Authority" INFO [2020-02-19 21:14:02.99]: ▸ "skid"<blob>=0x88271709A9B618608BECEBBAF64759C55254A3B7 "\210'\027\011\251\266\030\213\354\353\272\366GY\305RT\243\267” INFO [2020-02-19 21:14:02.99]: ▸ “snbr”<blob>=0x01DEBCC4396DA010 “\001\336\274\3049m\240\020” INFO [2020-02-19 21:14:02.99]: ▸ “subj”<blob>=0x308196310B300906035504061302555331133011060355040A0C0A4170706C6520496E632E312C302A060355040B0C234170706C6520576F726C647769646520446576656C6F7065722052656C6174696F6E733144304206035504030C3B4170706C6520576F726C647769646520446576656C6F7065722052656C6174696F6E732043657274696669636174696F6E20417574686F72697479 “0\201\2261\0130\011\006\003U\004\006\023\002US1\0230\021\006\003U\004\012\014\012Apple Inc.1,0*\006\003U\004\013\014#Apple Worldwide Developer Relations1D0B\006\003U\004\003\014;Apple Worldwide Developer Relations Certification Authority” WARN [2020-02-19 21:14:03.26]: Creating new provisioning profile for ‘com.malauzai.entios1’ with name ‘match InHouse com.malauzai.entios1’ for ‘ios’ platform INFO [2020-02-19 21:14:03.27]: ----------------------------- INFO [2020-02-19 21:14:03.27]: — Step: delete_keychain — INFO [2020-02-19 21:14:03.27]: ----------------------------- WARN [2020-02-19 21:14:03.31]: Lane Context: INFO [2020-02-19 21:14:03.31]: {:PLATFORM_NAME=>nil, :LANE_NAME=>“build_application”, :ORIGINAL_DEFAULT_KEYCHAIN=>“"/Users/runner/Library/Keychains/login.keychain-db"”} ERROR [2020-02-19 21:14:03.31]: can’t modify frozen String: “true” INFO [2020-02-19 21:14:03.31]: Successfully generated documentation at path ‘/Users/runner/runners/2.164.8/work/1/s/ios/fastlane/README.md’

±-----±----------------------±------------+ | fastlane summary | ±-----±----------------------±------------+ | Step | Action | Time (in s) | ±-----±----------------------±------------+ | 1 | import_from_git | 4 | | 2 | xcode_select | 0 | | 3 | create_keychain | 0 | | 💥 | get_provisioning_info | 7 | | 5 | delete_keychain | 0 | ±-----±----------------------±------------+

DEBUG [2020-02-19 21:14:03.43]: All plugins are up to date ERROR [2020-02-19 21:14:03.43]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane… Search query: can’t modify frozen String: “true”

URL: https://api.github.com/search/issues?q=can’t modify frozen String%3A “true”+repo:fastlane/fastlane ➡️ can’t modify frozen String https://github.com/fastlane/fastlane/issues/15415 [closed] 3 💬 30 Nov 2019

➡️ CI tests are currently failing because of faraday 0.16.x update https://github.com/fastlane/fastlane/issues/15398 [closed] 9 💬 6 weeks ago

➡️ “Can’t modify frozen String” error when setting output_name in Gymfile via ENV[…] https://github.com/fastlane/fastlane/issues/8548 [closed] 6 💬 18 Jun 2017

🔗 You can ⌘ + double-click on links to open them directly in your browser. DEBUG [2020-02-19 21:14:03.77]: All plugins are up to date bundler: failed to load command: fastlane (/usr/local/lib/ruby/gems/2.7.0/bin/fastlane) FrozenError: [!] can’t modify frozen String: “true” /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/base.rb:298:in gsub!' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/base.rb:298:in block in inspect_value’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/base.rb:296:in map' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/base.rb:296:in inspect_value’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/base.rb:286:in inspect' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/base.rb:305:in to_s’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/portal/provisioning_profile.rb:262:in create!' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/sigh/lib/sigh/runner.rb:135:in create_profile!’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/sigh/lib/sigh/runner.rb:40:in run' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/sigh/lib/sigh/manager.rb:8:in start’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/match/lib/match/generator.rb:92:in generate_provisioning_profile' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/match/lib/match/runner.rb:250:in fetch_provisioning_profile’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/match/lib/match/runner.rb:103:in block (2 levels) in run' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/match/lib/match/runner.rb:102:in loop’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/match/lib/match/runner.rb:102:in block in run' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/match/lib/match/runner.rb:101:in each’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/match/lib/match/runner.rb:101:in run' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/actions/sync_code_signing.rb:13:in run’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:261:in block (2 levels) in execute_action' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in execute_action’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:253:in block in execute_action' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in chdir’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in execute_action' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/other_action.rb:23:in method_missing' /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/fl_clone20200219-19584-1jktjuh/fastlane/actions/get_provisioning_info.rb:51:in run’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:261:in block (2 levels) in execute_action' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in execute_action’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:253:in block in execute_action' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in chdir’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in execute_action' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing' ../../../../../../../../../var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/fl_clone20200219-19584-1jktjuh/fastlane/Fastfile:42:in block in parsing_binding’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/lane.rb:33:in call' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:49:in block in execute’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:45:in chdir' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:45:in execute’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/lane_manager.rb:56:in cruise_lane' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run' /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call’ /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run' /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!' /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:349:in run' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:41:in start’ /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in take_off' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/bin/fastlane:23:in <top (required)>’ /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in load' /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in <top (required)>’ start of stderr: end of stderr]

Environment

 [$ fastlane env
[21:46:02]: ▸ /usr/local/lib/ruby/gems/2.7.0/gems/faraday_middleware-0.13.1/lib/faraday_middleware/response_middleware.rb:14: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
[21:46:02]: ▸ [21:46:02]: Generating fastlane environment output, this might take a few seconds...
[21:46:03]: ▸ 
✅ fastlane environment ✅ [21:46:03]: ▸ ### Stack [21:46:03]: ▸ | Key | Value | [21:46:03]: ▸ | --------------------------- | ------------------------------------------- | [21:46:03]: ▸ | OS | 10.15.3 | [21:46:03]: ▸ | Ruby | 2.7.0 | [21:46:03]: ▸ | Bundler? | true | [21:46:03]: ▸ | Git | git version 2.25.0 | [21:46:03]: ▸ | Installation Source | /usr/local/lib/ruby/gems/2.7.0/bin/fastlane | [21:46:03]: ▸ | Host | Mac OS X 10.15.3 (19D76) | [21:46:03]: ▸ | Ruby Lib Dir | /usr/local/Cellar/ruby/2.7.0/lib | [21:46:03]: ▸ | OpenSSL Version | OpenSSL 1.1.1d 10 Sep 2019 | [21:46:03]: ▸ | Is contained | false | [21:46:03]: ▸ | Is homebrew | false | [21:46:03]: ▸ | Is installed via Fabric.app | false | [21:46:03]: ▸ | Xcode Path | /Applications/Xcode.app/Contents/Developer/ | [21:46:03]: ▸ | Xcode Version | 11.3.1 | [21:46:03]: ▸ ### System Locale [21:46:03]: ▸ | Variable | Value | | [21:46:03]: ▸ | -------- | ----------- | - | [21:46:03]: ▸ | LANG | en_US.UTF-8 | ✅ | [21:46:03]: ▸ | LC_ALL | en_US.UTF-8 | ✅ | [21:46:03]: ▸ | LANGUAGE | | | [21:46:03]: ▸ ### fastlane files: [21:46:03]: ▸
`./Fastfile` [21:46:03]: ▸ ```ruby [21:46:03]: ▸ git_url = UI.interactive? ? File.expand_path('~/fastlane') : myGitURL [21:46:03]: ▸ import_from_git(url: git_url, [21:46:03]: ▸ branch: ENV['FASTLANE_BRANCH'] || 'staging', [21:46:03]: ▸ path: 'Fastfile') [21:46:03]: ▸ ``` [21:46:03]: ▸
[21:46:03]: ▸ **No Appfile found** [21:46:03]: ▸ ### fastlane gems [21:46:03]: ▸ | Gem | Version | Update-Status | [21:46:03]: ▸ | -------- | ------- | ------------- | [21:46:03]: ▸ | fastlane | 2.142.0 | ✅ Up-To-Date | [21:46:03]: ▸ ### Loaded fastlane plugins: [21:46:03]: ▸ | Plugin | Version | Update-Status | [21:46:03]: ▸ | ----------------------- | ------- | ------------- | [21:46:03]: ▸ | fastlane-plugin-appicon | 0.14.1 | ✅ Up-To-Date | [21:46:03]: ▸
Loaded gems [21:46:03]: ▸ | Gem | Version | [21:46:03]: ▸ | ------------------------- | ------------ | [21:46:03]: ▸ | did_you_mean | 1.4.0 | [21:46:03]: ▸ | CFPropertyList | 3.0.2 | [21:46:03]: ▸ | concurrent-ruby | 1.1.5 | [21:46:03]: ▸ | i18n | 0.9.5 | [21:46:03]: ▸ | minitest | 5.11.3 | [21:46:03]: ▸ | thread_safe | 0.3.6 | [21:46:03]: ▸ | tzinfo | 1.2.5 | [21:46:03]: ▸ | activesupport | 4.2.11.1 | [21:46:03]: ▸ | public_suffix | 2.0.5 | [21:46:03]: ▸ | addressable | 2.7.0 | [21:46:03]: ▸ | atomos | 0.1.3 | [21:46:03]: ▸ | babosa | 1.0.3 | [21:46:03]: ▸ | bundler | 2.1.4 | [21:46:03]: ▸ | claide | 1.0.3 | [21:46:03]: ▸ | fuzzy_match | 2.0.4 | [21:46:03]: ▸ | nap | 1.1.0 | [21:46:03]: ▸ | cocoapods-core | 1.7.5 | [21:46:03]: ▸ | cocoapods-deintegrate | 1.0.4 | [21:46:03]: ▸ | cocoapods-downloader | 1.2.2 | [21:46:03]: ▸ | cocoapods-plugins | 1.0.0 | [21:46:03]: ▸ | cocoapods-search | 1.0.0 | [21:46:03]: ▸ | cocoapods-stats | 1.1.0 | [21:46:03]: ▸ | netrc | 0.11.0 | [21:46:03]: ▸ | cocoapods-trunk | 1.4.0 | [21:46:03]: ▸ | cocoapods-try | 1.1.0 | [21:46:03]: ▸ | colored2 | 3.1.2 | [21:46:03]: ▸ | escape | 0.0.4 | [21:46:03]: ▸ | fourflusher | 2.3.1 | [21:46:03]: ▸ | gh_inspector | 1.1.3 | [21:46:03]: ▸ | molinillo | 0.6.6 | [21:46:03]: ▸ | ruby-macho | 1.4.0 | [21:46:03]: ▸ | nanaimo | 0.2.6 | [21:46:03]: ▸ | xcodeproj | 1.15.0 | [21:46:03]: ▸ | cocoapods | 1.7.5 | [21:46:03]: ▸ | colored | 1.2 | [21:46:03]: ▸ | highline | 1.7.10 | [21:46:03]: ▸ | commander-fastlane | 4.4.6 | [21:46:03]: ▸ | declarative | 0.0.10 | [21:46:03]: ▸ | declarative-option | 0.1.0 | [21:46:03]: ▸ | digest-crc | 0.4.1 | [21:46:03]: ▸ | unf_ext | 0.0.7.6 | [21:46:03]: ▸ | unf | 0.1.4 | [21:46:03]: ▸ | domain_name | 0.5.20190701 | [21:46:03]: ▸ | dotenv | 2.7.5 | [21:46:03]: ▸ | emoji_regex | 1.0.1 | [21:46:03]: ▸ | ffi | 1.11.1 | [21:46:03]: ▸ | ethon | 0.12.0 | [21:46:03]: ▸ | excon | 0.72.0 | [21:46:03]: ▸ | multipart-post | 2.0.0 | [21:46:03]: ▸ | faraday | 0.17.3 | [21:46:03]: ▸ | http-cookie | 1.0.3 | [21:46:03]: ▸ | faraday-cookie_jar | 0.0.6 | [21:46:03]: ▸ | faraday_middleware | 0.13.1 | [21:46:03]: ▸ | fastimage | 2.1.7 | [21:46:03]: ▸ | jwt | 2.1.0 | [21:46:03]: ▸ | memoist | 0.16.2 | [21:46:03]: ▸ | multi_json | 1.14.1 | [21:46:03]: ▸ | os | 1.0.1 | [21:46:03]: ▸ | signet | 0.12.0 | [21:46:03]: ▸ | googleauth | 0.10.0 | [21:46:03]: ▸ | httpclient | 2.8.3 | [21:46:03]: ▸ | mini_mime | 1.0.2 | [21:46:03]: ▸ | uber | 0.1.0 | [21:46:03]: ▸ | representable | 3.0.4 | [21:46:03]: ▸ | retriable | 3.1.2 | [21:46:03]: ▸ | google-api-client | 0.36.4 | [21:46:03]: ▸ | google-cloud-env | 1.3.0 | [21:46:03]: ▸ | google-cloud-errors | 1.0.0 | [21:46:03]: ▸ | google-cloud-core | 1.5.0 | [21:46:03]: ▸ | google-cloud-storage | 1.25.1 | [21:46:03]: ▸ | json | 2.3.0 | [21:46:03]: ▸ | mini_magick | 4.10.1 | [21:46:03]: ▸ | multi_xml | 0.6.0 | [21:46:03]: ▸ | plist | 3.5.0 | [21:46:03]: ▸ | rubyzip | 1.3.0 | [21:46:03]: ▸ | security | 0.1.3 | [21:46:03]: ▸ | naturally | 2.2.0 | [21:46:03]: ▸ | simctl | 1.6.8 | [21:46:03]: ▸ | slack-notifier | 2.3.2 | [21:46:03]: ▸ | terminal-notifier | 2.0.0 | [21:46:03]: ▸ | unicode-display_width | 1.6.1 | [21:46:03]: ▸ | terminal-table | 1.8.0 | [21:46:03]: ▸ | tty-screen | 0.7.1 | [21:46:03]: ▸ | tty-cursor | 0.7.1 | [21:46:03]: ▸ | tty-spinner | 0.9.3 | [21:46:03]: ▸ | word_wrap | 1.0.0 | [21:46:03]: ▸ | rouge | 2.0.7 | [21:46:03]: ▸ | xcpretty | 0.3.0 | [21:46:03]: ▸ | xcpretty-travis-formatter | 1.0.0 | [21:46:03]: ▸ | fastlane-plugin-appicon | 0.14.1 | [21:46:03]: ▸ | mime-types-data | 3.2019.1009 | [21:46:03]: ▸ | mime-types | 3.3.1 | [21:46:03]: ▸ | httparty | 0.17.0 | [21:46:03]: ▸ | gitlab | 4.12.0 | [21:46:03]: ▸ | mini_portile2 | 2.4.0 | [21:46:03]: ▸ | nokogiri | 1.10.4 | [21:46:03]: ▸ | ox | 2.11.0 | [21:46:03]: ▸ | roo | 2.8.2 | [21:46:03]: ▸ | typhoeus | 1.3.1 | [21:46:03]: ▸
[21:46:03]: ▸ *generated on:* **2020-02-19** [21:46:03]: ▸
]

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 42 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Yes @MikeBenton2 . Downgrading to 2.6.5 works.

More details on the root cause of this issue:

Ruby 2.7 has been released recently with the FrozenError feature. Also, the methods such as to_s started to return a frozen String. Hence the calls to Fastlane SDKs, which uses to_s internally, are failing with the error message can't modify frozen String error. Please find below the links that has more details on this issue.

https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/ https://sourcediving.com/less-known-changes-in-ruby-2-7-8d5db660370f

I got the error today locally and the only thing I changed on my computer was updating Ruby to 2.7.0. I tried the same thing in Ruby 2.6.5 and it works. Tried with the latest version of Fastlane (2.142.0).

TLDR: I does not work (at least for me) with Ruby 2.7.0.

Updating my build pipeline to use macOS-10.15 worked for me.

In our case the problem was solved by making a change in spaceship/lib/spaceship/portal/provisioning_profile.rb line 262. Before:

raise "Missing required parameter 'certificate'. e.g. use `Spaceship::Portal::Certificate::Production.all.first`" if certificate.to_s.empty?

After:

raise "Missing required parameter 'certificate'. e.g. use `Spaceship::Portal::Certificate::Production.all.first`" if certificate.empty?

We have removed to_s near the end of the line.

If you think that’s a viable solution I can submit a PR.

🚫 fastlane environment 🚫

Stack

Key Value
OS 10.14.6
Ruby 2.7.0
Bundler? true
Git git version 2.21.1 (Apple Git-122.3)
Installation Source ~/devel/mobileid-ios/vendor/bundle/ruby/2.7.0/bin/fastlane
Host Mac OS X 10.14.6 (18G3020)
Ruby Lib Dir /usr/local/Cellar/ruby/2.7.0/lib
OpenSSL Version OpenSSL 1.1.1d 10 Sep 2019
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.3.1

System Locale

Variable Value
LANG pl_PL.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
fastlane_require 'xcodeproj'
fastlane_require "spaceship"
fastlane_require "badge"
fastlane_require "appicon"
fastlane_require 'nokogiri'

require_relative 'App'
require_relative 'Plugins'
require_relative 'Keys'
require_relative 'Info'
require_relative 'Environment'
require_relative 'Configuration'
require_relative 'Account'
require_relative 'privacyContexts'

default_platform(:ios)

skip_docs

WORKSPACE = File.realpath("#{__dir__}/../mobileID.xcworkspace")
PROJECT ||= "mID/mobileID.xcodeproj"
TARGET ||= "mIDTF"
SOURCE_PATH ||= "mID/mobileID"
SHARED_SOURCE_PATH ||= "../mobileIDShared/mobileIDShared"
BUILD_PATH = "./build"
PROFILES_PATH = "#{Dir.home}/Library/MobileDevice/Provisioning Profiles/"
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "SWIFT_ACTIVE_COMPILATION_CONDITIONS"

ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "300"
ENV["LC_ALL"] = "en_US.UTF-8"
ENV["LANG"] = "en_US.UTF-8"

Privacy_Config_Path = "#{SHARED_SOURCE_PATH}/Flow/MainScreen/MainScreenPluginPrivacy/PrivacyContext/AutoPrivacyContext.swift"
Conf_Template_path = "./AutoConfigurationTemplate.swift"
Privacy_Conf_Template_Path = "./AutoPrivacyTemplate.swift"
Icon_path="./icon.png"

platform :ios do
  before_all do |lane, options|
    source = options[:source]
    if source.nil?
      UI.important "Missing JSON as parameter (bundle exec fastlane release source:config.json)"
      Account = Account.new()
    else
      Dir.chdir("..") do
        App = App.new(source)
        Account = Account.new(file_path: "#{File.dirname("#{source}")}/#{App.account}", is_ci: is_ci?)
        Plugins = Plugins.new("#{File.dirname("#{source}")}/#{App.plugins}")
        Keys = Keys.new("#{File.dirname("#{source}")}/#{App.keys}")
        Info = Info.new("#{File.dirname("#{source}")}/#{App.info}")
        Environment = Environment.new(source)
        Configuration = Configuration.new(source)
        Privacy = PrivacyContexts.new("#{File.dirname("#{source}")}/#{App.privacyContexts}")
      end

      # Run Theme if needed
      if App.bundleId != get_build_setting(key: "PRODUCT_BUNDLE_IDENTIFIER")
        UI.important "Mismatch of BundleIds, fixing it..."
        theme(options)
      end
    end
  end

  desc "Clean up and Setup"
  lane :clean do
    clear_derived_data(derived_data_path: BUILD_PATH)
    clean_simulators
    if is_ci?
      setup_jenkins
    end
  end

  desc "Clean simluators"
  lane :clean_simulators do
    sh("xcrun simctl shutdown all")
    sh("xcrun simctl erase all")
    sh("defaults write ~/Library/Preferences/com.apple.iphonesimulator ConnectHardwareKeyboard -bool no")
  end

  desc "Theme application as defined in the config.json passed as parameter"
  lane :theme do |options|
    fetch_profiles(options)

    # Update Build configuration and plist
    update_app_identifier(app_identifier: App.bundleId, plist_path: PLIST_PATH)

    if !App.version.nil?
      Dir.chdir("..") do
        sh("agvtool new-marketing-version #{App.version}")
      end
    end

    ignore_tests = "^((?!Test).)*$"
    compilation_conditions = []
    if Environment.isDev? || Environment.isDemo?
      compilation_conditions = ["CUSTOM_CONFIGURATION_ENABLED", "VERBOSE_LOGGING_ENABLED"]
    end

    set_certificates()

    set_build_setting(key: SWIFT_ACTIVE_COMPILATION_CONDITIONS, value: compilation_conditions.join(" "), clearContent: true, targetMatch: ignore_tests, project_path: "../../CommonUtils/CommonUtils.xcodeproj")
    set_build_setting(key: SWIFT_ACTIVE_COMPILATION_CONDITIONS, value: "DEBUG", clearContent: false, targetMatch: ignore_tests, configMatch: "Debug", project_path: "../../CommonUtils/CommonUtils.xcodeproj")

    set_info_plist_value(path: PLIST_PATH, key: "CFBundleDisplayName", value: App.shortName.to_s)
    set_info_plist_value(path: PLIST_PATH, key: "ApplicationLongName", value: App.longName.to_s)
    set_info_plist_value(path: PLIST_UITEST_PATH, key: "ApplicationLongName", value: App.longName.to_s)

    configure_app_environment(addFlag: Environment.isDemo?)

    autoconfig()

    Dir.chdir("..") do
      # Update Schemes
      sh("../scripts/update_scheme.sh #{App.schemes.join(" ")} #{PLIST_PATH}")

      # Update styles
      new_styles = File.read("#{File.dirname(options[:source])}/#{App.styles}")
      File.open(App.styles, "w") {|file| file.puts new_styles}
    end

    theme_assets()
    if options[:forDistribute].nil?
      ci_prepare(options)
    else
      distribute_prepare(options)
    end
  end

  desc "Generates AutoConfiguration from the template"
  lane :autoconfig do
    conf_temp = File.read(Conf_Template_path)
    privacy_conf_temp = File.read(Privacy_Conf_Template_Path)

    Dir.chdir("..") do
      # Auto Configuration
      new_config = Environment.generateConfiguration(new_config:conf_temp)
      if !Environment.isDev? && !Environment.isDemo?
        Plugins.excludedPlugins = "MainMenuPluginSettings"
      end
      new_config = Plugins.generateConfiguration(new_config: new_config, env:App.environments.first)
      new_config = Info.generateConfiguration(new_config: new_config)
      new_config = Keys.generateConfiguration(new_config: new_config)
      new_config = Configuration.generateConfiguration(flavour: App.flavour, new_config: new_config)
      File.open(Auto_config_path, "w") {|file| file.puts new_config}
      sh("../Pods/SwiftFormat/CommandLineTool/swiftformat #{Auto_config_path}")

      # Privacy Configuration
      new_privacy_config = Privacy.generateConfiguration(new_config: privacy_conf_temp)
      File.open(Privacy_Config_Path, "w") { |file| file.puts new_privacy_config}
      sh("../Pods/SwiftFormat/CommandLineTool/swiftformat #{Privacy_Config_Path}")

      sh("../scripts/run-swiftlint.sh")
    end
  end

  desc "Sets up dependencies"
  lane :dependencies do
    begin
      cocoapods()
    rescue => ex
      UI.important "Performing repo update and retrying pod install"
      sh("pod repo-art update smartsdk")
      sh("pod repo update")
      cocoapods()
    end
    update_session()
  end

  desc "Runs tests for a given scheme reports in jUnit and Html"
  lane :test do |options|
    clean = options[:clean].nil? ? true : options[:clean]
    if !clean
      Dir.chdir("..") do
        sh("rm -rf #{BUILD_PATH}/tests/system_logs*")
      end
    end
    sh("rm  ../*/build/tests/screenshots/* || true")
    scan(
      clean: clean,
      workspace: WORKSPACE,
      scheme: TARGET,
      derived_data_path: "#{BUILD_PATH}/tests",
      output_directory: "#{BUILD_PATH}/tests",
      prelaunch_simulator: true
    )
    coverage(options)
  end

  desc "Builds for the given configuration"
  lane :build do |options|
    configuration = options[:config].capitalize
    derivedDataPath = "derivedData/#{TARGET}"
    debugDestination = sh("xcodebuild -showsdks | grep iphonesimulator | tail -1 | grep -o '\\-sdk.*'").to_s.split("\n").last
    destination = configuration == "Debug" ? debugDestination : "-destination generic/platform=iOS"

    Dir.chdir("..") do
      sh("xcodebuild build -workspace '#{WORKSPACE}' \
                          -scheme '#{TARGET}' \
                          -configuration #{configuration} \
                          #{destination} \
                          -derivedDataPath #{derivedDataPath} \
                          -quiet")
    end
  end

  desc "Builds and archives the application for debug, meant for local installation"
  lane :debug do |options|
    archive(options.merge!(config: "debug"))
  end

  desc "Builds and archives the application for release, meant for TestFlight"
  lane :release do |options|
    update_deploy_build_number()
    archive(options.merge!(config: "release"))
  end

  desc "Deploys application for nightly builds- this step is meant to be triggered by CI"
  lane :deploy_nightly do |options|
    set_info_plist_value(path: PLIST_PATH, key: "ITSAppUsesNonExemptEncryption", value: false)
    deploy(options)
  end

  desc "Deploys application passed as paramter - this step is meant to be triggered by CI"
  lane :deploy do |options|
    ahead = `git rev-list origin/develop..HEAD --count`.to_i
    if ahead != 0
      UI.user_error!("Develop is behind (" + ahead.to_s + "), Merge this branch into develop to continue")
    end

    if is_ci?
      release(options)

      changelog = File.read("../#{BUILD_PATH}/output/changelog.md").gsub! '#', ''
      pilot(
        username: Account.apple_id,
        team_id: Account.itc_team_id,
        app_identifier: App.bundleId,
        skip_submission: true,
        ipa:"#{BUILD_PATH}/output/" + App.suffix(environment: Environment.description) + ".ipa",
        changelog: changelog
      )

      tag(options)
      setJiraFixVersion()
    else
      puts "⚠️  This Lane should be triggered by a CI - Never manually".yellow
    end
  end

  desc "Distribute is an end-to-end lane that builds archives and deploys the app for a given config file"
  lane :distribute do |options|
    # DEPENDENCIES
    clear_derived_data(derived_data_path: BUILD_PATH)
    dependencies()

    # THEME
    options[:forDistribute] = true
    theme(options)

    # ARCHIVE
    release(options)

    # DEPLOY
    pilot(
      username: Account.apple_id,
      team_id: Account.itc_team_id,
      app_identifier: App.bundleId,
      skip_submission: true,
      ipa:"#{BUILD_PATH}/output/" + App.suffix(environment: Environment.description) + ".ipa"
    )

  end

  desc "Resets Account data"
  lane :reset_account do
    Account.reset()
  end
end

desc "Gathers coverage for a given scheme"
private_lane :coverage do |options|
  slather(
    proj: PROJECT,
    workspace: WORKSPACE,
    build_directory: BUILD_PATH,
    source_directory: SOURCE_PATH,
    output_directory: "#{BUILD_PATH}/tests",
    cobertura_xml: true,
    scheme: TARGET,
    jenkins: true,
    use_bundle_exec: true,
    binary_basename: getListOfBinaries(options)
  )
end

desc "Adds a tag with the build number and the env used"
private_lane :tag do |options|
  version = get_version_number(xcodeproj: PROJECT, target: TARGET)
  build = get_build_number(xcodeproj: PROJECT)
  environment = Environment.description.upcase

  add_git_tag(
    tag: "builds/#{version}/#{build}-#{environment}-#{App.flavour}",
    message: "#{version} (#{build}) | #{environment} #{App.flavour}"
    # commit: `git log --format="%H" -n 1 origin/develop`
  )

  begin
    push_git_tags
  rescue => ex
    UI.important ex.message
  end
end

desc "Prepare the build for export phase in CI"
private_lane :ci_prepare do |options|
  if is_ci?
    # Update build version
    build = `git rev-list --first-parent --count origin/develop`.chomp
    increment_build_number(build_number: build.to_s)

    version_number = get_version_number(xcodeproj: PROJECT, target: TARGET)
    Dir.chdir("..") do
      # init tag if needed
      if sh("../scripts/latest_tag.sh #{version_number}").empty?
        tag(options)
      end

      # Create changelog
      sh("../scripts/changelog.sh #{version_number} #{build} '#{Environment.description.to_s.upcase}' '#{App.flavour}'")
    end

    if !Environment.isProd? && !Environment.isDemo?
      add_badge(
        no_badge: true,
        grayscale: Environment.isUAT?,
        shield: version_number + "-" + build + "-orange")
    end
  end
end

desc "Prepare build for distribute lane"
private_lane :distribute_prepare do |options|
    # Update build version
    build = options[:build]
    if build.nil?
      build = `git rev-list --first-parent --count HEAD`.chomp
    end
    increment_build_number(build_number: build.to_s)

    version_number = get_version_number(xcodeproj: PROJECT, target: TARGET)
    if !Environment.isProd? && !Environment.isDemo?
      add_badge(
        no_badge: true,
        grayscale: Environment.isUAT?,
        shield: version_number + "-" + build + "-orange")
    end
end

desc "Archives the app for a given configuration"
private_lane :archive do |options|
  configuration = options[:config]

  export_options = {
    uploadBitcode: false,
    uploadSymbols: false,
    compileBitcode: false
  }

  if isDebug?(options)
    export_method = "development"
  else
    export_method = "app-store"
    export_options[:thinning] = "<thin-for-all-variants>"
  end

  gym(
    clean: options[:clean].nil? ? true : options[:clean],
    workspace: WORKSPACE,
    scheme: TARGET,
    configuration:configuration.to_s.capitalize,
    build_path: BUILD_PATH,
    output_directory: "#{BUILD_PATH}/output",
    output_name: App.suffix(environment: Environment.description) + ".ipa",
    include_bitcode: false,
    include_symbols: false,
    export_team_id: Account.team_id,
    export_method: export_method,
    export_options: export_options
  )
end

private_lane :fetch_profiles do |options|
  isXcode11 = sh("xcodebuild -version").include?("Xcode 11.")
  ["development", "appstore"].each do |configuration|
    matching_profile = match(
      force_for_new_devices: configuration != "appstore",
      type: configuration,
      generate_apple_certs: isXcode11,
      app_identifier: App.bundleId,
      username:	Account.apple_id,
      team_id: Account.team_id
    )

    profile = Dir.entries("#{PROFILES_PATH}").select { |f|
      f.to_s.include?(".mobileprovision")
    }.select { |f|
      content = File.open("#{PROFILES_PATH}/#{f}").read
      profile_value(content, "Name") == matching_profile[App.bundleId]
    }.first

    update_project_provisioning(
      xcodeproj: PROJECT,
      build_configuration: configuration == "development" ? "Debug" : "Release",
      profile: "#{PROFILES_PATH}#{profile}"
    )
  end
end

desc "Update apple's session"
private_lane :update_session do
  spaceauth_output = `bundle exec fastlane spaceauth`
  fastlane_session_regex = %r{Pass the following via the FASTLANE_SESSION environment variable:\n(?<session>.+)\n\n\nExample:\n.+}
  new_session = nil

  if match = spaceauth_output.match(fastlane_session_regex)
    new_session = match[:session].gsub("\e[4m\e[36m", "").gsub("\e[0m\e[0m", "")
  end

  if !new_session.nil?
    ENV["FASTLANE_SESSION"] = new_session
    UI.important "Session updated!"
  else
    UI.user_error!("Unable to obtain new session via fastlane spaceauth")
  end
end

desc "Sets needed certificates to copy_certificates script"
private_lane :set_certificates do
  key = "CERTIFICATES"
  file_name = "../../scripts/copy_certificates.sh"
  copy_certificates_script = File.read(file_name)

  certs_needed = ["###{key}##\n", "\n###{key}##"]
  certs_needed.insert(1, Environment.pinningCertificates)

  updated_file = copy_certificates_script.gsub(/###{key}##\n(.*)\n###{key}##/, certs_needed.join(' '))
  File.open(file_name, "w") { |file| file.puts updated_file }
end

desc "Update Bundle short version number"
private_lane :update_deploy_build_number do |options|
  env_number = Environment.allTypes.index(Environment.currentType.downcase)
  current_build_number = get_build_number(xcodeproj: PROJECT)
  tf_build_number = latest_testflight_build_number(
    version: get_version_number(xcodeproj: PROJECT, target: TARGET),
    app_identifier: App.bundleId
  )
  increment_build_number({
    build_number: "#{[current_build_number.to_f, tf_build_number.to_f + 0.1].max.round(1).to_s}.#{env_number}"
  })
end

#####################
# private functions #
#####################

def setJiraFixVersion()
  if is_ci?
    version = get_version_number(xcodeproj: PROJECT, target: TARGET)
    build = get_build_number(xcodeproj: PROJECT)
    environment = Environment.description.upcase

    fixVersion =  "\"#{environment}_#{version}.#{build}\""

    Dir.chdir("..") do
      # Updates Fix Version in JIRA
      tickets(changelog: "#{BUILD_PATH}/output/changelog.md").each do |ticket|
        next unless ticket.start_with?('MIMID')
        sh("../scripts/set_fix_version.sh #{ticket} #{fixVersion}")
      end
    end
  end
end

def isDebug?(options)
  return options[:config].to_s.downcase == "debug"
end

def tickets(changelog:)
  tickets = []
  text = File.open("#{changelog}").read
  text.gsub!(/\r\n?/, "\n")
  text.each_line do |line|
    ticketId = line.scan(/[A-Z]+-\d+/).first.to_s
    if !ticketId.empty?
      tickets.push(ticketId)
    end
  end

  return tickets
end

def theme_assets()
  Dir.chdir("..") do
    UI.important "▸ Generating Assets..."
    App.assets.generateAssetsFromImages(destination_folder: Assets_path)

    UI.important "▸ Styling AppIcon"
    App.assets.styleForAppIcon(
      asset: App.assets.list.select {|s| s.name == "main_app_icon" }.first,
      destination_folder: Icon_path
    )

    UI.important "▸ Adecuating LaunchScreen's textColor"
    App.assets.setTextColorForLaunchScreen(
      asset: asset = App.assets.list.select {|s| s.name.to_s == "splash_image" }.first,
      launchScreen: LaunchScreen_path
    )
  end

  appicon(
    appicon_image_file: Icon_path,
    appicon_devices: [:ipad, :iphone, :ios_marketing],
    appicon_path: Assets_path
  )
end

def getListOfBinaries(options)
  listOfBinaries = []
  options.each do |opt|
    if opt.first.to_s.start_with?('binary')
      listOfBinaries << opt.last.to_s
    end
  end
  return listOfBinaries
end

def get_build_setting(key:, targetMatch: ".", project_path: "../#{PROJECT}")
  project = Xcodeproj::Project.open(project_path)
  project.targets.each do |target|
    target.build_configurations.each do |config|
      if /#{targetMatch}/.match(target.to_s)
        return config.build_settings["#{key}"].to_s
      end
    end
  end
end

def set_build_setting(key:, value:, clearContent: true, targetMatch: ".", configMatch: ".", project_path: "../#{PROJECT}")
  project = Xcodeproj::Project.open(project_path)
  project.targets.each do |target|
    target.build_configurations.each do |config|
      if /#{targetMatch}/.match(target.to_s) && /#{configMatch}/.match(config.to_s)
        current_flags = config.build_settings["#{key}"].to_s
        new_value = clearContent == true ? "#{value}" : "#{current_flags} #{value}"
        config.build_settings["#{key}"] = new_value.rstrip
        puts "Flag added in #{target} for #{key} => #{config.build_settings["#{key}"]}"
      end
    end
  end
  project::save()
end

# addFlag set to false will remove traces of environment type, if one exists (i.e. will cleanup)
def configure_app_environment(addFlag: true, targetMatch: ".", configMatch: ".", project_path: "../#{PROJECT}")
  all_envs = Environment.allTypes.map { |t|  "IS_#{t.upcase}"}
  curr_env = "IS_#{Environment.currentType}"
  project = Xcodeproj::Project.open(project_path)
  project.targets.each do |target|
    target.build_configurations.each do |config|
      if /#{targetMatch}/.match(target.to_s) && /#{configMatch}/.match(config.to_s)
        current_flags = config.build_settings[SWIFT_ACTIVE_COMPILATION_CONDITIONS] || ""
        if !addFlag && !all_envs.any? { |e| current_flags.include?(e) }
          next
        elsif !current_flags.empty?
          current_flags.slice!("$(inherited)")
          all_envs.each { |x| current_flags.slice!(x) }
        end
        new_value = (addFlag == true) ? "$(inherited) #{current_flags} #{curr_env}" : "$(inherited) #{current_flags}"
        config.build_settings[SWIFT_ACTIVE_COMPILATION_CONDITIONS] = new_value.split.join(" ")
        puts "App environment flag #{addFlag ? "added[#{curr_env}]" : "removed"} in #{target}[#{config.to_s}]"
      end
    end
  end
  project::save()
end

# returns value for key in mobileprovisioning file
def profile_value(profile_contents, name)
	profile_contents = profile_contents.slice(profile_contents.index('<?'), profile_contents.length)
	doc = Nokogiri.XML(profile_contents)
	return doc.xpath('//key[text()="' + name + '"]')[0].next_element.text
end

`./fastlane/Appfile`
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.140.0 🚫 Update available

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-versioning 0.4.2 ✅ Up-To-Date
fastlane-plugin-badge 1.4.0 ✅ Up-To-Date
fastlane-plugin-appicon 0.14.1 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.4.0
bundler 2.1.2
uri 0.10.0
CFPropertyList 3.0.2
concurrent-ruby 1.1.5
i18n 0.9.5
minitest 5.14.0
thread_safe 0.3.6
tzinfo 1.2.6
activesupport 4.2.11.1
public_suffix 2.0.5
addressable 2.7.0
highline 1.7.10
commander 4.4.6
json 2.3.0
appicon 0.0.3
atomos 0.1.3
babosa 1.0.3
curb 0.9.10
fastimage 2.1.7
colored 1.2
commander-fastlane 4.4.6
dotenv 2.7.5
emoji_regex 1.0.1
excon 0.71.1
multipart-post 2.0.0
faraday 0.17.3
unf_ext 0.0.7.6
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
faraday_middleware 0.13.1
gh_inspector 1.1.3
jwt 2.1.0
memoist 0.16.2
multi_json 1.14.1
os 1.0.1
signet 0.12.0
googleauth 0.10.0
httpclient 2.8.3
mini_mime 1.0.2
declarative 0.0.10
declarative-option 0.1.0
uber 0.1.0
representable 3.0.4
retriable 3.1.2
google-api-client 0.36.4
digest-crc 0.4.1
google-cloud-env 1.3.0
google-cloud-errors 1.0.0
google-cloud-core 1.5.0
google-cloud-storage 1.25.1
mini_magick 4.10.1
multi_xml 0.6.0
plist 3.5.0
rubyzip 1.3.0
security 0.1.3
naturally 2.2.0
simctl 1.6.7
slack-notifier 2.3.2
terminal-notifier 2.0.0
unicode-display_width 1.6.1
terminal-table 1.8.0
tty-screen 0.7.0
tty-cursor 0.7.0
tty-spinner 0.9.2
word_wrap 1.0.0
claide 1.0.3
colored2 3.1.2
nanaimo 0.2.6
xcodeproj 1.14.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.0
badge 0.12.0
clamp 1.3.1
fuzzy_match 2.0.4
nap 1.1.0
cocoapods-core 1.5.3
cocoapods-deintegrate 1.0.4
cocoapods-downloader 1.2.2
cocoapods-plugins 1.0.0
cocoapods-search 1.0.0
cocoapods-stats 1.1.0
netrc 0.11.0
cocoapods-trunk 1.3.1
cocoapods-try 1.1.0
escape 0.0.4
fourflusher 2.3.1
molinillo 0.6.6
ruby-macho 1.4.0
cocoapods 1.5.3
cocoapods-art 1.0.3
coderay 1.1.2
color 1.8
fastlane-plugin-appicon 0.14.1
fastlane-plugin-badge 1.4.0
fastlane-plugin-versioning 0.4.2
method_source 0.9.2
mini_portile2 2.4.0
nokogiri 1.10.7
pry 0.12.2
slather 2.4.7

generated on: 2020-02-25

edit file: /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.142.0/spaceship/lib/spaceship/base.rb:298

line 298 change from v.gsub!("\n", "\n\t") # to align nested elements to: v = v.gsub("\n", "\n\t") # to align nested elements

then it works for me.

downgrade ruby 2.7.0 (macOS 10.15 default version) to 2.6.5 solves the error.

This fixed the problem for us, from our Fastfile:

# Fix for https://github.com/fastlane/fastlane/issues/16055
# Because we won't downgrade to Ruby 2.6.

module DataHashFix
  def inspect_value
    attributes.map do |k|
      v = send(k).inspect
      v = v.gsub("\n", "\n\t") # note no !

      "\t#{k}=#{v}"
    end.join(", \n")
  end
end

Spaceship::Base::DataHash.include DataHashFix

@ajklotz I was also still seeing this issue today when running on macOS-10.14, as it appeared that Ruby 2.7.0 was still the default on that agent specification. I think that the solution @defaultbr provided above is a good option if you can’t move to using macOS-10.15.

Thank you @defaultbr. I was going down that road last night a bit, but after taking another look at it this AM, it appears that the macOS-10.15 agent specification is setup to use Ruby 2.6.5 by default with Fastlane 2.142.0 (the latest version), and this has fixed all of my problems 😃.

Summarized output from agent using ruby -v & fastlane env:

ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
...
[14:30:11]: Generating fastlane environment output, this might take a few seconds...
<details><summary>✅ fastlane environment ✅</summary>

### Stack

| Key                         | Value                                              |
| --------------------------- | -------------------------------------------------- |
| OS                          | 10.15.3                                            |
| Ruby                        | 2.6.5                                              |
| Bundler?                    | false                                              |
| Git                         | git version 2.25.0                                 |
| Installation Source         | /usr/local/lib/ruby/gems/2.6.0/bin/fastlane        |
| Host                        | Mac OS X 10.15.3 (19D76)                           |
| Ruby Lib Dir                | /usr/local/Cellar/ruby@2.6/2.6.5/lib               |
| OpenSSL Version             | OpenSSL 1.1.1d  10 Sep 2019                        |
| Is contained                | false                                              |
| Is homebrew                 | false                                              |
| Is installed via Fabric.app | false                                              |
| Xcode Path                  | /Applications/Xcode_11.3.1.app/Contents/Developer/ |
| Xcode Version               | 11.3.1                                             |

I don’t see this updated in the MS docs ATM, but at least it works ¯_(ツ)_/¯.

@ballenstein yes, i had the same problem, i solved it using this commands in the latest agent:

  1. add the task to use ruby 2.6.5 (Fixed version, so the version spec=2.6.5) and tick the “Add to Path”

  2. add bash script with the following lines:

brew cask uninstall fastlane
gem uninstall fastlane || true
gem install fastlane -NV
export PATH="/usr/local/bin/fastlane:$PATH"

can you try and say if it works for you too?