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

时间:2019-09-12 07:03:24

标签: ios flutter dart

我的flutter项目无法在ios设备上获取。  我已经在命令sudo gem install cocoapods下尝试过,但是我需要密码,而dunno需要密码!!!!

颤动运行:

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.

12 个答案:

答案 0 :(得分:24)

打开“终端”,然后导航至flutter项目。 然后通过cd ios在“ ios”文件夹中导航并运行pod install

对我来说,问题是没有安装吊舱。

答案 1 :(得分:9)

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

rm ios/Podfile

之后,用

构建项目
flutter build ios

它为我解决了问题。

答案 2 :(得分:3)

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

    cd your_file_path

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

    cd ios

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

    pod init

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

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

  6. 再次运行您的项目。

答案 3 :(得分:3)

尝试安装Pod

pod install

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

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

答案 4 :(得分:2)

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

1 Debug.xcconfig

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

2 Release.xcconfig

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

答案 5 :(得分:0)

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

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

现在应该可以正常工作了,因为我认为必须在工作场所进行修复。

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

答案 6 :(得分:0)

100%可行

  1. 打开iso / flutter / Debug.xcconfig:1
  2. 删除以下行 #include“ Pods /目标支持文件/Pods-Runner/Pods-Runner.debug.xcconfig”

请注意,应单独使用此行#include“ Generated.xcconfig”

答案 7 :(得分:0)

我假设您的Flutter项目中已经有ios/个文件夹。如果没有,您可以运行flutter build ios

大多数情况下,此错误的根本原因发生在克隆了Github之类的项目之后。

要修复,您需要获取软件包并安装Pod。

flutter clean
flutter pub get
cd ios/
pod install 

在某些情况下,您可能需要更新Pod Repo和Pod。您可以通过运行

pod repo update
pod update

答案 8 :(得分:0)

我尝试了上述所有解决方案,包括完全重新创建ios文件夹。最终有效的方法是取消注释ios / Podfile中的platform :ios

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

对此:

# Uncomment this line to define a global platform for your project
  platform :ios, '9.0'

答案 9 :(得分:0)

我遇到了同样的问题,但所有给定的解决方案都不适合我。

什么对我有用:

  • 删除您的 podfile(确保备份它)。
  • 现在将生成一个新的 podfile 或尝试 pod init 命令。
  • 现在重新运行您的项目,它应该可以工作了。

答案 10 :(得分:0)

就我而言:

   cd /[path_to_project_directory]/ios/

然后

   pod update

修复了

答案 11 :(得分:0)

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"