我最近尝试运行我的 flutter 应用程序。但是,当我尝试这样做时,出现以下错误:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Application launch for 'com.[redacted]' did not return a valid pid
nor a launch error.
No such process
Command: /usr/bin/arch -arm64e xcrun simctl launch AA375D1F-5CFC-4D1B-B367-
4CB98488D7DA
com.[redacted] --enable-dart-profiling
--enable-checked-mode --verify-entry-points --observatory-port=0
Error launching application on iPhone 13.
为了尝试解决此问题,我运行了 flutter doctor,但出现了以下错误:
See https://github.com/flutter/flutter/issues/6207 for more information
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Community Edition (version 2022.1.2)
[✓] VS Code (version 1.67.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
我已经尝试卸载并重新安装 flutter,但仍然遇到相同的错误。我真的很困惑为什么会发生这种情况,我非常感谢一些帮助。预先感谢您!
运行此命令后:
$ sudo softwareupdate --install-rosetta --agree-to-license
,
问题似乎已得到解决。我运行了 flutter doctor,这就是输出:
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Community Edition (version 2022.1.2)
[✓] VS Code (version 1.67.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
(忽略android问题-我故意没有安装它们)。
我在我的 mac M1 上遇到了同样的错误。 看起来,rosetta 没有正确安装。 使用安装rosetta。
sudo softwareupdate --install-rosetta --agree-to-license
就我而言,我有一个 M1,2020,但收到错误“无法下载可执行文件”
1- 使用
升级到最新版本的 flutterflutter upgrade
2-然后删除bin缓存文件
rm -r ~/Documents/SDK/flutter/bin/cache
运行“flutter doctor”,你应该已经准备好了