我正在尝试使用Mac的ios模拟器来模拟我的Flutter应用程序,但出现此错误。在升级Android Studio和Xcode之前,它工作正常。
Launching lib/main.dart on iPhone X in debug mode...
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: Multiple commands produce '/Users/User/AndroidStudioProjects/my_app/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/User/AndroidStudioProjects/my_app/ios/Flutter/Flutter.framework' to '/Users/User/AndroidStudioProjects/my_app/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
warning: ignoring duplicated output file: '/Users/User/AndroidStudioProjects/my_app/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone X.
使用:
应该固定在master
频道中
https://github.com/flutter/flutter/issues/20685#issuecomment-421511890
解决方法
有两种解决方法:
- 选项1:使用旧版构建系统。如@ gi097所述,打开
ios/Runner.xcworkspace
,并将构建系统更改为Legacy Build System
。- 选项2:使用新的Xcode 10构建系统。
- 打开
ios/Runner.xcworkspace
Runner
在项目导航器侧栏中选择项目。- 在主视图中,选择
Runner
目标,然后选择Build Phases
选项卡。- 扩展
Embed Frameworks
阶段,然后Flutter.framework
从嵌入式框架列表中进行选择。- 单击
-
以Flutter.framework
从列表中删除(请确保保留App.framework
)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句