When using fastlane and cocoapods to build our iOS app I noticed that fastlane does not use the version of cocoapods that I have installed using
sudo gem install cocoapods
When running
pod --version
it returns the latest version which is of this moment
1.3.1
However, when running a build lane in fastlane it uses cocoapods version 1.2.1 for some reason.
I use this in my Fastfile to clean and pod install
cocoapods(
clean: true,
podfile: "Podfile"
)
Is there a way I can tel fastlane to use a specific version of cocoapods? Or use the version I have installed manually?
1.11. 3 - March 16, 2022 (287 KB)
<Specifying pod versions Later on in the project you may want to freeze to a specific version of a Pod, in which case you can specify that version number. Besides no version, or a specific one, it is also possible to use logical operators: '> 0.1' Any version higher than 0.1. '>= 0.1' Version 0.1 and any higher version.
You should have Cocoapods running on your M1 Mac.
It's recommended to use a Gemfile:
It is recommended that you use a Gemfile
to define your dependency on fastlane. This will clearly define the used fastlane version, and its dependencies, and will also speed up using fastlane.
sudo gem install bundler
./Gemfile
in the root directory of your project with the content:source "https://rubygems.org" gem 'fastlane' gem 'cocoapods'
[sudo] bundle update
and add both the ./Gemfile
and the ./Gemfile.lock
to version controlbundle exec fastlane [lane]
[sudo] bundle install
as your first build step[sudo] bundle update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With