Launching lib/main.dart on iPhone 11 Pro Max 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. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install:
  sudo gem install cocoapods

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

最佳答案

此问题可能是因为您安装了多个版本的cocoapods。
您可以检查并解决它的运行情况:

  • gem list检查是否安装了多个版本的cocoapod
  • sudo gem uninstall cocoapods它会提示您选择要卸载的那个,或者是否要卸载所有
  • sudo gem install cocoapods

  • 如果您卸载了所有cocoapods,则执行附加步骤
  • 切换到Flutter项目的iOS目录
  • pod install

  • 然后,您应该可以在iOS设备上运行xcode构建。

    10-07 12:41
    查看更多