简体   繁体   English

如何在CodeMagic上设置特定版本的cocoapods

[英]How can I setup a specific version of cocoapods on codemagic

The version of cocoapods in my codemagic workflow is lower than what is used by my Flutter project. 我的codemagic工作流程中的cocoapods版本低于Flutter项目使用的版本。 How can I setup a specific version of cocoapods for my codemagic workflow? 如何为我的Codemagic工作流程设置特定版本的cocoapods?

Thank you 谢谢
Søren 索伦

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. 那么您需要先卸载默认的CocoaPods版本,然后再安装正确的版本。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM