3

The version of cocoapods in my codemagic workflow is lower than what is used by my Flutter project. How can I setup a specific version of cocoapods for my codemagic workflow?

Thank you
Søren

Mikhail Tokarev
  • 2,843
  • 1
  • 14
  • 35
Neigaard
  • 3,726
  • 9
  • 49
  • 85

1 Answers1

8

If you get similar message in build log

[!] The version of CocoaPods used to generate the lockfile (1.7.2) is higher than the version of the current executable (1.6.1). Incompatibility issues may arise.

then you need to uninstall default CocoaPods version first and then install the correct one. You can do it via next pre-build script.

#!/bin/sh

set -e # exit on first failed command
set -x # print all executed commands to the log

gem uninstall cocoapods --all
gem install cocoapods -v 1.7.2

cd $FCI_BUILD_DIR/ios
pod install
Mikhail Tokarev
  • 2,843
  • 1
  • 14
  • 35
  • I have a similar issue with codemagic and iOS build. I cannot, however, figure out, where and how to apply the above script. Would you be so kind and give me some hints? – Angel Todorov Feb 25 '20 at 16:05
  • 1
    @AngelTodorov go to App Settings > Plus sign after Test and before Build section > Pre-build script if you use yaml file just add those commands to `scripts` block – Mikhail Tokarev Feb 25 '20 at 16:44
  • Thanks, @Mikhail Tokarev. And in case I want to compile with XCode 11.1 which cocoapods version should I use? – Angel Todorov Feb 25 '20 at 16:45
  • I think it depends on what version you use locally and what cocoapods version pods are compatible – Mikhail Tokarev Feb 25 '20 at 16:48
  • 1
    Well, this is a problem, since I have no local iOS build - this is why I need codemagic. The thing is, couple of month ago I have built iOS app with Flutter 1.9.1+hotfix6 and Xcode 11.1. Now, I tried the build a new app version with the very same Futter and XCode and the iOS build failed. – Angel Todorov Feb 25 '20 at 16:53
  • 1
    I see... I'd suggest to check latest successful build to find used cocoapods version information or check on rubygems site what was the stable version on that date https://rubygems.org/gems/cocoapods/versions – Mikhail Tokarev Feb 25 '20 at 16:56