Android Studio无法运行Xcode模拟器 [英] Android Studio cannot run the Xcode Simulator
本文介绍了Android Studio无法运行Xcode模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Xcode iPhone Simulator模拟Flutter应用程序,但出现此错误.在升级Android Studio和Xcode之前,它工作正常.
I am trying to simulate my Flutter app with the Xcode iPhone Simulator and I get this error. Before upgrading Android Studio and Xcode it was working fine.
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.
使用:
- macOS 10.13.6(17G65)
- Android Studio 3.2内部版本#AI-181.5540.7.32.5014246,建于2018年9月18日
- Xcode 10.0(10A255)
- Xcode Simulator 10.0(SimulatorApp-869.5 CoreSimulator-572.2)
推荐答案
应在 master
频道
https://github.com/flutter/flutter/issues/20685#issuecomment-421511890
解决方法
有两种解决方法:
Workarounds
There are two workarounds:
- 选项1:使用旧版构建系统.如@ gi097所述,打开
ios/Runner.xcworkspace
,然后将构建系统更改为Legacy Build系统. - 选项2:使用新的Xcode 10构建系统.
- Option 1: Use the legacy build system . As noted by @gi097, open
ios/Runner.xcworkspace
, and change the build system toLegacy Build System
. - Option 2: Use the new Xcode 10 build system.
- 打开
ios/Runner.xcworkspace
- 在项目导航器侧边栏中选择
Runner
项目. - 在主视图中,选择
Runner
目标,然后选择Build Phases
标签. - 展开
Embed Frameworks
阶段,然后从嵌入式框架列表中选择Flutter.framework
. - 单击
-
从列表中删除Flutter.framework
(请确保保持 App.framework )
- Open
ios/Runner.xcworkspace
- Select the
Runner
project in the project navigator sidebar. - In the main view, select the
Runner
target, then select theBuild Phases
tab. - Expand the
Embed Frameworks
phase and selectFlutter.framework
from the embedded frameworks list. - Click
-
to removeFlutter.framework
from the list (be sure to keepApp.framework
).
这篇关于Android Studio无法运行Xcode模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文