我正在尝试使用 Xcode iPhone 模拟器模拟我的 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.
Using:
- macOS 10.13.6 (17G65)
- Android Studio 3.2 内部版本 #AI-181.5540.7.32.5014246,构建于 2018 年 9 月 18 日
- Xcode 10.0 (10A255)
- Xcode 模拟器 10.0 (SimulatorApp-869.5 CoreSimulator-572.2)
应固定在master
channel
https://github.com/flutter/flutter/issues/20685#issuecomment-421511890 https://github.com/flutter/flutter/issues/20685#issuecomment-421511890
解决方法
有两种解决方法:
-
选项 1:使用旧版构建系统。正如 @gi097 所指出的,打开
ios/Runner.xcworkspace
,并将构建系统更改为Legacy Build
System
.
-
Option 2: Use the new Xcode 10 build system.
- Open
ios/Runner.xcworkspace
- 选择
Runner
项目导航器侧栏中的项目。
- 在主视图中,选择
Runner
目标,然后选择Build Phases
tab.
- 展开
Embed Frameworks
阶段并选择Flutter.framework
从嵌入式框架列表中。
- Click
-
去除Flutter.framework
从列表中(务必keep App.framework
).
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)