【问题标题】:I can't solve (Could not build the my application for the simulator.) flutter我无法解决(无法为模拟器构建我的应用程序。)
【发布时间】:2021-12-16 00:44:15
【问题描述】:

昨天,我将我的 macbook 更新到 macOS Mouterey,然后更新 Xcode 然后当打开 Android Studio 时,我会在颤动中运行我的应用程序 我得到这个错误:

    Launching lib/main.dart on iPhone 12 in debug mode...
Running pod install...
Running Xcode build...
Xcode build done.                                            5.3s
Failed to build iOS app
Error output from Xcode build:
↳
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
    { platform:iOS Simulator, id:4A32C7DF-2445-4177-9C26-584684610C84, OS:15.0, name:iPad (9th generation) }
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    ** BUILD FAILED **
Xcode's output:
↳
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    xxxx/myproject/ios/Flutter/Debug.xcconfig:1:1: error: unable to open file (in target "Runner" in project "Runner")
   xxxx/myproject/ios/Flutter/Debug.xcconfig:1:1: error: unable to open file (in target "Runner" in project "Runner")
   xxxx/myproject/ios/Flutter/Debug.xcconfig:1:1: error: unable to open file (in target "Runner" in project "Runner")

    warning: Unable to read contents of XCFileList '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist' (in target 'Runner' from project 'Runner')
    error: Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-input-files.xcfilelist' (in target 'Runner' from project 'Runner')
    error: Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-output-files.xcfilelist' (in target 'Runner' from project 'Runner')

Could not build the application for the simulator.
Error launching application on iPhone 12.

【问题讨论】:

  • 你试过 Flutter Clean 吗?还有 Flutter Doctor 的输出是什么?
  • 是的,我尝试运行 flutter clean ,并且 flutter doctor 的输出也可以

标签: ios flutter dart flutter-layout ios-simulator


【解决方案1】:

在您的 xcode 中,您必须将兼容性更改为第 9 代或更低,因为您使用的是 iphone 12...查看图片

【讨论】:

  • 好的,我换成Xcode 10、11、13,不行
  • 不,只是改变项目格式...
  • 是的,我的意思是项目格式,比如你的图片
  • 你改成什么了?
  • 我将项目格式更改为兼容 Xcode 10
猜你喜欢
  • 2021-09-27
  • 2021-01-18
  • 2011-01-04
  • 2021-01-23
  • 2021-09-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多