【问题标题】:Android Studio cannot run the Xcode SimulatorAndroid Studio 无法运行 Xcode 模拟器
【发布时间】:2019-03-03 03:41:43
【问题描述】:

我正在尝试使用 Xcode iPhone Simulator 模拟我的 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.

使用:

  • macOS 10.13.6 (17G65)
  • Android Studio 3.2 Build #AI-181.5540.7.32.5014246,于 2018 年 9 月 18 日构建
  • Xcode 10.0 (10A255)
  • Xcode 模拟器 10.0 (SimulatorApp-869.5 CoreSimulator-572.2)

【问题讨论】:

    标签: xcode macos android-studio flutter


    【解决方案1】:

    应该固定在master频道

    https://github.com/flutter/flutter/issues/20685#issuecomment-421511890

    解决方法

    有两种解决方法:

    • 选项 1:使用旧版构建系统。 如 @gi097 所述,打开 ios/Runner.xcworkspace,并将构建系统更改为 Legacy Build System。
    • 选项 2:使用新的 Xcode 10 构建系统。
      1. 打开ios/Runner.xcworkspace
      2. 在项目导航器侧边栏中选择Runner 项目。
      3. 在主视图中,选择Runner 目标,然后选择Build Phases 选项卡。
      4. 展开Embed Frameworks 阶段并从嵌入式框架列表中选择Flutter.framework。
      5. 单击- 将Flutter.framework 从列表中删除(请务必保留 App.framework)。

    【讨论】:

      猜你喜欢
      • 2020-08-17
      • 1970-01-01
      • 2015-05-18
      • 1970-01-01
      • 1970-01-01
      • 2015-05-06
      • 1970-01-01
      • 2016-09-09
      • 1970-01-01
      相关资源
      最近更新 更多