简体   繁体   English

Flutter 模块不会在 iOS 中构建

[英]Flutter Module won't build in iOS

I'm getting this error when trying to build iOS app with flutter module injected in it.尝试构建注入了 flutter 模块的 iOS 应用程序时出现此错误。 I added the FLUTTER_ROOT and flutter dependencies in pod are successfully installed but the build fails getting this error:我在 pod 中添加了 FLUTTER_ROOT 和 flutter 依赖项已成功安装,但构建失败,出现此错误:

ERROR: Unknown FLUTTER_BUILD_MODE: vedur_dev.
Valid values are 'Debug', 'Profile', or 'Release' (case insensitive).
This is controlled by the FLUTTER_BUILD_MODE environment variable.
If that is not set, the CONFIGURATION environment variable is used.

You can fix this by either adding an appropriately named build
configuration, or adding an appropriate value for FLUTTER_BUILD_MODE to the
.xcconfig file for the current build configuration (Vedur_Dev).

I added FLUTTER_BUILD_MODE in User-Defined Settings in TARGETS App like this:我在 TARGETS App 的 User-Defined Settings 中添加了 FLUTTER_BUILD_MODE ,如下所示: 在此处输入图片说明 And assigned the values iOS understands.并分配了 iOS 理解的值。 I clean the project, but getting exactly the same error.我清理了项目,但得到了完全相同的错误。 I'm not sure where am I making a mistake.我不确定我在哪里犯了错误。

Edit: App builds just fine without the module.编辑:应用程序在没有模块的情况下构建得很好。

We have seen this on our build system as well.我们也在我们的构建系统上看到了这一点。 The problem seems to be that the flutter scripts can't figure out what kind of build you are running.问题似乎是 flutter 脚本无法确定您正在运行哪种构建。 So to set the FLUTTER_BUILD_MODE environment variable to Release fixed it.所以将FLUTTER_BUILD_MODE环境变量设置为Release修复了它。

Valid values are Debug , Profile , or Release有效值为DebugProfileRelease

Guide for setting enviroment variables for Xcode . 为 Xcode 设置环境变量的指南 ( Or via scripts. ) 或通过脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM