错误:在搜索路径中找不到包含文件“Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig”(在目标“Runner”中)

Shr*_*rma 35 xcode ios dart cocoapods flutter

我的颤振项目无法在 ios 设备上运行。我试过下面的命令sudo gem install cocoapods

颤动运行:

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.
To install:
  sudo gem install cocoapods
  pod setup



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


Xcode's output:
?
    error: /Users/sukhjinder/StudioWorkspace/shrutiFlutterProjects/myapp/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')
   
    note: Using new build systemnote: Planning buildnote: Constructing build description

Could not build the precompiled application for the device.

Error launching application on iPhone.
Run Code Online (Sandbox Code Playgroud)

nec*_*ixy 44

打开“终端”并导航到您的颤振项目。然后在“ios”文件夹中导航cd ios并运行pod install

对我来说,问题是没有安装豆荚。


Jof*_*fre 19

打开终端,导航到项目并键入

rm ios/Podfile
Run Code Online (Sandbox Code Playgroud)

之后用

flutter build ios
Run Code Online (Sandbox Code Playgroud)

它为我解决了这个问题。

  • 很奇怪,这个解决方案对我有用,但前提是我在终端上点击 flutter run 。如果我尝试使用 Android Studio 运行该项目(绿色箭头),错误仍然存​​在。只是一个注释。 (2认同)

Dee*_*yan 9

就我而言,我在ios/Flutter文件夹中添加了 2 个文件

1 调试.xcconfig

 #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
 #include "Generated.xcconfig"
Run Code Online (Sandbox Code Playgroud)

2 发布.xcconfig

  #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
  #include "Generated.xcconfig"
Run Code Online (Sandbox Code Playgroud)


Blo*_*oss 8

尝试安装 pod

cd ios

pod install
Run Code Online (Sandbox Code Playgroud)

如果它不起作用,请按照这种方式

导航ios/Podfile文件并取消注释platform :ios, '9.0'(删除 #)


小智 6

Flutter/Release.xcconfig

#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"   

#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"  

#include "Generated.xcconfig"
Run Code Online (Sandbox Code Playgroud)

  • 请添加解释。请参阅[如何回答](https://stackoverflow.com/help/how-to-answer)。 (4认同)

hel*_*345 5

  1. 打开终端,通过键入以下内容导航到项目:

    cd your_file_path

  2. 然后输入以下命令导航到 iOS 文件夹:

    cd ios

  3. 最后,通过键入以下内容来实现缺少的 podfile 来解决您的问题:

    pod init

  4. 然后,打开新创建的 podfile,按照文件中的说明进行操作(告诉您删除文件第二行的注释)。

  5. 关闭您的 Flutter 项目,然后重新打开它。

  6. 再次运行您的项目。


Tar*_*eem 0

当我重构项目以移动主文件夹时,我遇到了类似的问题。为了解决这个问题,我在 Xcode 的工作区设置中做了以下操作:

  • 切换到Legacy Build System(如@Sumeet Jain 在评论中所解释的)。
  • 执行构建,应该可以工作。
  • 切换回New Build System (Default).
  • 再次运行构建。

现在应该可以工作了,因为我认为它一定已经在工作场所设置中进行了修复。

仅供参考,工作区构建设置可以在 Xcode 文件菜单中找到:“文件/工作区设置”。然后在对话框中的“共享工作区”部分下查找“构建系统”下拉列表。