Multiple commands produce '/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework

Flutter 运行在Android上没有问题,在IOS上出现以下问题:

Multiple commands produce '/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework

Target 'Runner' has copy command from '/ios/Flutter/Flutter.framework' to '/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
warning: ignoring duplicated output file: '//build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Constructing build description
Mac 10.14 Beta
Xcode 10 beta

使用Xcode 10构建的所有Flutter项目都会有该问题。在使用插件时,有两个竞争构建操作将Flutter.framework复制到构建应用程序Frameworks目录中:

Embed框架为Runner项目构建阶段
[CP]嵌入Pods框架构建pod安装在项目中创建的阶段。
第一项用于确保在没有插件的情况下将框架复制到构建的应用程序中(因此在Xcode项目中没有CocoaPods集成)。
第二项是因为Flutter的podspec将Flutter.framework声明为vended_framework,而CocoaPods会自动为CocoaPods依赖项的传递闭包中的每个这样的vended_framework添加一个复制步骤。

解决方案有两个
1、将XCODE的编译系统改为legacy build system,如下图所示
Multiple commands produce '/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework_第1张图片
2:使用新的Xcode 10构建系统。
打开ios / Runner.xcworkspace
在项目导航器侧栏中选择Runner项目。
在主视图中,选择Runner目标,然后选择Build Phases选项卡。
展开Embed Frameworks阶段并从嵌入式框架列表中选择Flutter.framework。
单击 - 从列表中删除Flutter.framework(确保保留App.framework)。

文章地址:https://blog.csdn.net/u013560890/article/details/96476861

你可能感兴趣的:(Multiple commands produce '/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework)