KMM with CocoaPods. Error: cocoapods-generate requires CocoaPods >= 1.5.0
KMM with CocoaPods. Error: cocoapods-generate requires CocoaPods >= 1.5.0
我正在尝试向测试 kmm 项目添加一个简单的 CocoaPods 依赖项,如 this tutorial
中所述
很遗憾,我遇到了这个错误
Executing of 'pod gen --platforms=ios --gen-directory=/Users/par/code/my/MyApplication/shared/build/cocoapods/synthetic/IOS --sources=https://cdn.cocoapods.org /Users/par/code/my/MyApplication/shared/shared.podspec' failed with code 1 and message:
[!] cocoapods-generate requires CocoaPods >= 1.5.0
如何解决这个错误?
我的设置
cocoapods version: 1.11.2
cocoapods-generate version: 1.4.1
Mac OS Big Sur 11.6
看来cocoapods-generate的版本已经过时了。脚本最新版本为2.2.2
无论我怎么努力,我都无法将 cocoapods-generate 升级到 1.4.1 以上
我用这个命令安装它
sudo gem install cocoapods-generate
中找到了这条信息
The underlying error is that cocoapods-generate at version 2.2.1 cannot be installed on ruby 3, because it depends on cocoapods-disable-podfile-validations ~> 0.1.1,and the only version of cocoapods-disable-podfile-validations satisfying that (0.1.1) needs ruby ~> 2.1.
不知道如何解决这个难题。
通过将 ruby 降级到 2.6
解决了这个问题
brew install rvm
curl -sSL https://get.rvm.io | bash
rvm install ruby-2.6.0
我正在尝试向测试 kmm 项目添加一个简单的 CocoaPods 依赖项,如 this tutorial
中所述很遗憾,我遇到了这个错误
Executing of 'pod gen --platforms=ios --gen-directory=/Users/par/code/my/MyApplication/shared/build/cocoapods/synthetic/IOS --sources=https://cdn.cocoapods.org /Users/par/code/my/MyApplication/shared/shared.podspec' failed with code 1 and message:
[!] cocoapods-generate requires CocoaPods >= 1.5.0
如何解决这个错误?
我的设置
cocoapods version: 1.11.2
cocoapods-generate version: 1.4.1
Mac OS Big Sur 11.6
看来cocoapods-generate的版本已经过时了。脚本最新版本为2.2.2
无论我怎么努力,我都无法将 cocoapods-generate 升级到 1.4.1 以上 我用这个命令安装它
sudo gem install cocoapods-generate
中找到了这条信息
The underlying error is that cocoapods-generate at version 2.2.1 cannot be installed on ruby 3, because it depends on cocoapods-disable-podfile-validations ~> 0.1.1,and the only version of cocoapods-disable-podfile-validations satisfying that (0.1.1) needs ruby ~> 2.1.
不知道如何解决这个难题。
通过将 ruby 降级到 2.6
解决了这个问题brew install rvm
curl -sSL https://get.rvm.io | bash
rvm install ruby-2.6.0