运行flutter项目时无法识别pod命令

Posted

技术标签:

【中文标题】运行flutter项目时无法识别pod命令【英文标题】:pod command is not recognized when running flutter project 【发布时间】:2020-03-05 03:32:07 【问题描述】:

我已经尝试了堆栈溢出和 GitHub 中的所有建议和解决方案,但我无法运行 pod install 并且我得到 pod : command not found ,我的 pod 文件也是空的。

 Warning: CocoaPods 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 install:
  sudo gem install cocoapods

Running Xcode build...
Xcode build done.                                            6.4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


 Xcode's output:
↳
    error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1: 
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
    error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1: 
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
    error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1: 
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
    error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1: 
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
    error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1: 
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
    error: /Users/seyedaliaghamali/Documents/projects/my_app/ios/Flutter/Debug.xcconfig:1: 
could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-
Runner.debug.xcconfig' in search paths (in target 'Runner')
    warning: Capabilities for Runner may not function correctly because its entitlements 
use a placeholder team ID. To resolve this, select a development team in the build settings 
editor. (in target 'Runner')
    note: Using new build systemnote: Planning buildnote: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone Xʀ.

【问题讨论】:

看看这个问题 - 它应该可以解决你的问题***.com/questions/37904588/cocoapods-not-installing 然后我又得到了同样的错误 运行 pod --version 会得到什么? pod:找不到命令 检查***.com/questions/14202255/…是否有任何答案可以解决您的问题。顺便说一句,这不是颤振问题。 【参考方案1】:

该错误是由于未安装 CocoaPods 导致的,因此无法运行 pod install。只需安装 CocoaPods 即可解决此问题。运行 sudo gem install cocoapods 或在此 guide 之后不使用 sudo 安装它。

【讨论】:

以上是关于运行flutter项目时无法识别pod命令的主要内容,如果未能解决你的问题,请参考以下文章

红色的 Pods 框架(Xcode 无法识别)

Flutter小记1AndroidStudio 中无法识别iPhone/Android真机解决方案

Flutter小记1AndroidStudio 中无法识别iPhone/Android真机解决方案

颤振设备命令无法识别 android 设备

Flutter - 无法检测/识别 Android Studio

SBT 子项目无法识别插件命令