我无法解决(无法为模拟器构建我的应用程序。)

Posted

技术标签:

【中文标题】我无法解决(无法为模拟器构建我的应用程序。)【英文标题】: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 的输出也可以 【参考方案1】:

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

【讨论】:

好的,我换成Xcode 10、11、13,不行 不,只是改变项目格式... 是的,我的意思是项目格式,比如你的图片 你改成什么了? 我将项目格式更改为兼容 Xcode 10

以上是关于我无法解决(无法为模拟器构建我的应用程序。)的主要内容,如果未能解决你的问题,请参考以下文章

Xcode 编译我的应用程序,但无法在模拟器中运行它

为 iPhone 设备构建应用程序时无法验证应用程序错误

“无法为模拟器构建应用程序。” “在 iPhone 11 上启动应用程序时出错。”

将 cloud_firestore 添加到 pubspec Flutter 后无法为模拟器构建应用程序

iOS - 无法在设备上构建,但在 Xcode 4.6 上构建模拟器

我无法从 android studio 构建或运行我的颤振应用程序,但它可以从命令行运行