xcode_backend.sh:没有这样的文件或目录.我需要创建这个文件吗? [英] xcode_backend.sh: no such file or directory. Do I need to create this file?

查看:309
本文介绍了xcode_backend.sh:没有这样的文件或目录.我需要创建这个文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Flutter项目无法在ios模拟器上运行,并引发此错误:

My Flutter Project won't run on the ios simulator and is throwing this error:

以调试模式在iPhoneXʀ上启动lib/main.dart ...

Launching lib/main.dart on iPhone Xʀ in debug mode...

正在运行Xcode构建...

Running Xcode build...

Xcode构建完成. 7.6秒

Xcode build done. 7.6s

无法构建iOS应用

Xcode构建错误输出:

Error output from Xcode build:

**生成失败**

Xcode的输出:

===具有配置调试功能的项目运行器的构建目标运行器===

=== 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.

在iPhoneXʀ上启动应用程序时出错.

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 getflutter 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.xcconfigRelease.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 unter Project > Info > Configuration).

这篇关于xcode_backend.sh:没有这样的文件或目录.我需要创建这个文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆