Cocoapods 已安装但无法工作。 FVM 和 Cocoapods 问题

问题描述 投票:0回答:1

我正在尝试启动一个 2 年的 Flutter 项目,该项目依赖于很多很长时间没有更新的旧软件包,因此我必须使用 FVM 和旧版本在 Flutter 2.8.1 上启动它CocoaPods 是 1.12.1,但是由于某种原因,FVM 无法识别我的 Cocoapods。

起初问题出在 pods 版本上,我设法安装了旧版本。但现在,当我尝试使用 fvm flutter run 启动我的项目时,出现错误

fvm flutter run -d F580B7B0-B930-403C-96A4-C366472BE604 --flavor preprod -t lib/main_preprod.dart

Launching lib/main_preprod.dart on iPhone 12 Pro in debug mode...
Warning: CocoaPods is installed but broken. Skipping pod install.
  You appear to have CocoaPods installed but it is not working.
  This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
  This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

CocoaPods not installed or not in valid state.
Error launching application on iPhone 12 Pro.

我尝试将 pod 直接安装到 fvm/versions/2.8.1/bin 中,但不起作用。

我删除了 Flutter 以仅使用 FVM。

flutter cocoapods fvm
1个回答
0
投票

在终端中使用此命令

sudo gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod cache clean --all
rm Podfile
rm Podfile.lock 

答案参考

© www.soinside.com 2019 - 2024. All rights reserved.