Downloaded executables cannot execute on host. See https://github.com/flutter/flutter/issue...

[!] Flutter (Channel stable, 2.0.5, on macOS 11.3 20E232 darwin-x64, locale
    zh-Hans-CN)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.52.1)
[✓] Connected device (1 available)
    ! Error: Errors were encountered while preparing your device for
      development. Please check the Devices and Simulators Window.  (code -1)
    ! Error: iPad is not connected. Xcode will continue when iPad is connected.
      (code -13)

! Doctor found issues in 2 categories.

重新安装flutter时,运行flutter doctor,报如上述提示。
报错一:

[!] Flutter (Channel stable, 2.0.5, on macOS 11.3 20E232 darwin-x64, locale
    zh-Hans-CN)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information

参考文章:https://blog.csdn.net/u012359453/article/details/82431133
由于 我这次是重新安装,所以我觉得可能是缓存的问题,所以使用了清除缓存的方法。执行命令后,再次运行flutter doctor,报错消失。
解决方案:

rm -rf ~/flutter/bin/cache

报错二:

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses

报错中已经给出解决方案。运行后根据提示进行操作,再次执行flutter doctor,报错解决。
解决方案:

flutter doctor --android-licenses

你可能感兴趣的:(Downloaded executables cannot execute on host. See https://github.com/flutter/flutter/issue...)