提问者:小点点

Flutter 2升级:CocoaPods未安装或未处于有效状态


更新Flutter 2之后,我就不能再在iOS上部署我的应用了:

Warning: CocoaPods minimum required version 1.9.0 or greater not installed.
Skipping pod install.
  CocoaPods is used to retrieve the iOS and macOS platform side's plugin code
  that responds to your plugin usage on the Dart side.
  Without CocoaPods, plugins will not work on iOS or macOS.
  For more info, see https://flutter.dev/platform-plugins
To upgrade 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 11.
  • 因为我使用flavors:method
  • 宝石列表
  • SUDO gem卸载CocoApods
  • SUDO gem安装Cocoapods
  • POD安装
  • flutter clean+flutter pub升级/修复+删除派生数据,podfile.lock,pods
  • 从vsCode和XCODE重新启动/启动
$ gem which cocoapods
/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods.rb
$ pod --version                                                                                                                                                      
1.8.4
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.2, on macOS 11.2.3 20D91 darwin-x64, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[!] Xcode - develop for iOS and macOS
    ! CocoaPods 1.8.4 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.54.3)
[✓] Connected device (3 available)

我已经安装/卸载了几次cocoapods,但flutter似乎没有检测到最新版本


共1个答案

匿名用户

我与您分享解决了我的问题的方法:brew链接--覆盖cocoapods

如果这还不够,下面是我最具启发性的研究来源:

  • https://github.com/flutter/flutter/issues/14293#issuecomment-370522539
  • https://superuser.com/questions/686317/how-to-full-uninstall-the-cocoapods-from-the-mac-machine(第一个响应)