xcode_backend.sh:没有这样的文件或目录.我需要创建这个文件吗? [英] xcode_backend.sh: no such file or directory. Do I need to create this file?
问题描述
我的 Flutter 项目无法在 ios 模拟器上运行并抛出此错误:
My Flutter Project won't run on the ios simulator and is throwing this error:
在调试模式下在 iPhone Xʀ 上启动 lib/main.dart...
Launching lib/main.dart on iPhone Xʀ in debug mode...
正在运行 Xcode 构建...
Running Xcode build...
Xcode 构建完成.7.6s
Xcode build done. 7.6s
无法构建 iOS 应用
Failed to build iOS app
Xcode 构建的错误输出:
Error output from Xcode build:
↳
** 构建失败 **
Xcode 的输出:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/bin/sh:/Users/pinercode/AndroidStudioProjects/bmi-calculator-flutter/packages/flutter_tools/bin/xcode_backend.sh: 没有那个文件或目录
/bin/sh: /Users/pinercode/AndroidStudioProjects/bmi-calculator-flutter/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
无法为模拟器构建应用程序.
Could not build the application for the simulator.
在 iPhone Xʀ 上启动应用程序时出错.
Error launching application on iPhone Xʀ.
xcode 错误也如下:
The xcode error was also as follows:
/bin/sh:/Users/pinercode/AndroidStudioProjects/bmi-calculator-flutter/packages/flutter_tools/bin/xcode_backend.sh: 没有那个文件或目录
/bin/sh: /Users/pinercode/AndroidStudioProjects/bmi-calculator-flutter/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
我已经尝试过运行 flutter doctor 并且没有错误.我还尝试在构建设置中重新设置我的 xcode 'FLUTTER_ROOT' 和 'FLUTTER_APPLICATION_PATH',但没有成功.
I've already tried running flutter doctor and there were no errors. I also tried re-rooting my xcode 'FLUTTER_ROOT' and 'FLUTTER_APPLICATION_PATH' in build settings, which did not work.
推荐答案
基本上发生的情况是项目的构建阶段"之一正在运行脚本:
Basically what happens is that one of the project's 'Build Phases' is running a script:
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build
现在为了找到xcode_backend.sh
,需要定义FLUTTER_ROOT变量.它在一个名为 Flutter/Generated.xcconfig
的文件中定义,该文件在您运行 flutter pub get
或 flutter build
时生成.
Now in order to find xcode_backend.sh
the FLUTTER_ROOT variable needs to be defined. It is defined in a file called Flutter/Generated.xcconfig
, which is generated when you run flutter pub get
or flutter build
.
构建配置文件Debug.xcconfig
和Release.xcconfig
(在同一个Flutter 文件夹中)包括Generated.xcconfig
.现在唯一剩下的就是确保为每个项目配置正确设置这些构建配置文件(在 XCode 中的 Project > Info > Configuration 下).
The build configuration files Debug.xcconfig
and Release.xcconfig
(in the same Flutter folder) include Generated.xcconfig
.
Now the only thing left is to ensure that for each of the project configurations these build configuration files are properly set (in XCode under Project > Info > Configuration).
这篇关于xcode_backend.sh:没有这样的文件或目录.我需要创建这个文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!