Make sure that the Should update fastlane gem before run? (update_fastlane) option of the fastlane step is set to false.
That’s all. Of course, replace 2.18.3 with the version you want to use
Using a Gemfile & Gemfile.lock: if you use our fastlane step this is mentioned in the description of the step:
If Gemfile exists in the work_dir directory, fastlane will be used by bundle install && bundle exec.
If you’re familiar with Ruby projects and with how the Gemfile & Gemfile.lock works this is probably the best solution, and it’s pretty much 0 effort.
But if you don’t use a Gemfile & bundle exec on your Mac to run fastlane then the Script based solution above is probably easier to maintain. Up to you of course, the step can work with either solution
Hi There,
This regarding the maintaining same Fastlane version over the period of time. I mean can we install specific version as I see Fastlane gets new version everytime
To update this thread, the script step does not always work. It might be specific to the Xcode 11.3.x on Mojave stack but executing “gem uninstall fastlane” will results to a failure as there are already some components dependent on it.
ERROR: While executing gem … (Gem::DependencyRemovalException)
Uninstallation aborted due to dependent gem(s)
The way I worked around it is to find the usable version above the fastlane and gems that came with the image. For us it was 2.149.1 which worked for a while because that version was higher that the one in the image so we can “upgrade” rather installing from scratch.
Caveat that I said it worked for a while. Something changed in the gems since July 13 which is raising conflicts again. I was unable to find the conflicting package since the versions are identical prior to the mass-failure. I ended up upgrading to fastlane 2.152.0 which thankfully worked since the version that borked our builds was 2.150.0.
This is what I have in our workflows:
_set_Fastlane_overrides:
steps:
- script@1:
title: Execute fastlane override values.
run_if: '{{getenv "FASTLANE_OVERRIDE_EXECUTED" | eq "" }}'
inputs:
- content: |
#!/usr/bin/env bash
set -e
echo "[INFO] Setting the faslane version to 2.152.0 "
gem install fastlane --version 2.152.0 --no-document
#set the flag so this step will no longer execute if called again in
# the same execution
envman add --key "FASTLANE_OVERRIDE_EXECUTED" --value "true"