下载的可执行文件无法在主机上执行 - MacOS Monterey 12.4,Silicon Chip

shr*_*rey 2 ios flutter apple-m1 macos-monterey

我最近尝试运行我的 flutter 应用程序。但是,当我尝试这样做时,出现以下错误:

\n
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):\nApplication launch for 'com.[redacted]' did not return a valid pid \nnor a launch error.\nNo such process\nCommand: /usr/bin/arch -arm64e xcrun simctl launch AA375D1F-5CFC-4D1B-B367- \n4CB98488D7DA \ncom.[redacted] --enable-dart-profiling\n--enable-checked-mode --verify-entry-points --observatory-port=0\nError launching application on iPhone 13.\n
Run Code Online (Sandbox Code Playgroud)\n

为了尝试解决这个问题,我运行了 flutter doctor,但出现了以下错误:

\n
      See https://github.com/flutter/flutter/issues/6207 for more information\n\n[\xe2\x9c\x97] Android toolchain - develop for Android devices\n    \xe2\x9c\x97 Unable to locate Android SDK.\n      Install Android Studio from: https://developer.android.com/studio/index.html\n      On first launch it will assist you in installing the Android SDK components.\n      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).\n      If the Android SDK has been installed to a custom location, please use\n      `flutter config --android-sdk` to update to that location.\n\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 13.4)\n[\xe2\x9c\x93] Chrome - develop for the web\n[!] Android Studio (not installed)\n[\xe2\x9c\x93] IntelliJ IDEA Community Edition (version 2022.1.2)\n[\xe2\x9c\x93] VS Code (version 1.67.2)\n[\xe2\x9c\x93] Connected device (3 available)\n[\xe2\x9c\x93] HTTP Host Availability\n
Run Code Online (Sandbox Code Playgroud)\n

我已经尝试卸载并重新安装 flutter,但仍然遇到相同的错误。我真的很困惑为什么会发生这种情况,我非常感谢一些帮助。先感谢您!

\n

shr*_*rey 18

运行此命令后: $ sudo softwareupdate --install-rosetta --agree-to-license\n问题似乎已得到解决。我运行 flutter doctor,这是输出:

\n
[\xe2\x9c\x97] Android toolchain - develop for Android devices\n    \xe2\x9c\x97 Unable to locate Android SDK.\n      Install Android Studio from: https://developer.android.com/studio/index.html\n      On first launch it will assist you in installing the Android SDK components.\n      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).\n      If the Android SDK has been installed to a custom location, please use\n      `flutter config --android-sdk` to update to that location.\n\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 13.4)\n[\xe2\x9c\x93] Chrome - develop for the web\n[!] Android Studio (not installed)\n[\xe2\x9c\x93] IntelliJ IDEA Community Edition (version 2022.1.2)\n[\xe2\x9c\x93] VS Code (version 1.67.2)\n[\xe2\x9c\x93] Connected device (2 available)\n[\xe2\x9c\x93] HTTP Host Availability\n
Run Code Online (Sandbox Code Playgroud)\n

(忽略 Android 问题 - 我故意没有安装它们)。

\n