• Flutter Environmental Installation


    Install


    Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.A new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your teamicon-default.png?t=N7T8https://www.notion.so/serious-lose/Flutter-Environmental-Installation-ead2ea1520ba4129bda14372694b9d7e?pvs=4

    1. // 安装dart
    2. brew install dart
    1. ✘ @HLFdeMacBook-Pro  ~  flutter doctor
    2. Doctor summary (to see all details, run flutter doctor -v):
    3. [✓] Flutter (Channel stable, 3.13.8, on macOS 13.6 22G120 darwin-x64, locale zh-Hans-CN)
    4. [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    5. ✗ cmdline-tools component is missing
    6. Run `path/to/sdkmanager --install "cmdline-tools;latest"`
    7. See <https://developer.android.com/studio/command-line> for more details.
    8. ✗ Android license status unknown.
    9. Run `flutter doctor --android-licenses` to accept the SDK licenses.
    10. See <https://flutter.dev/docs/get-started/install/macos#android-setup> for more details.
    11. [!] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    12. ✗ Unable to get list of installed Simulator runtimes.
    13. ✗ CocoaPods not installed.
    14. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
    15. Without CocoaPods, plugins will not work on iOS or macOS.
    16. For more info, see
    17. To install see for instructions.
    18. [✓] Chrome - develop for the web
    19. [!] Android Studio (not installed)
    20. [✓] VS Code (version 1.78.1)
    21. [✓] Connected device (2 available)

    Android Studio (not installed)

    1. @HLFdeMacBook-Pro  ~  flutter doctor
    2. Doctor summary (to see all details, run flutter doctor -v):
    3. [✓] Flutter (Channel stable, 3.13.8, on macOS 13.6 22G120 darwin-x64, locale zh-Hans-CN)
    4. [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    5. ✗ cmdline-tools component is missing
    6. Run `path/to/sdkmanager --install "cmdline-tools;latest"`
    7. See <https://developer.android.com/studio/command-line> for more details.
    8. ✗ Android license status unknown.
    9. Run `flutter doctor --android-licenses` to accept the SDK licenses.
    10. See <https://flutter.dev/docs/get-started/install/macos#android-setup> for more details.
    11. [!] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    12. ✗ Unable to get list of installed Simulator runtimes.
    13. ✗ CocoaPods installed but not working.
    14. You appear to have CocoaPods installed but it is not working.
    15. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
    16. This can usually be fixed by re-installing CocoaPods.
    17. To re-install see <https://guides.cocoapods.org/using/getting-started.html#installation> for instructions.
    18. [✓] Chrome - develop for the web
    19. [✓] Android Studio (version 2022.3)
    20. [✓] VS Code (version 1.78.1)
    21. [✓] Connected device (2 available)
    22. [✓] Network resources

    Xcode - develop for iOS and macOS (Xcode 15.0.1)

    • 更新Xcode

    CocoaPods not installed

    1. // 查看是否安装
    2. gem list
    1. *** LOCAL GEMS ***
    2. ...
    3. cocoapods (1.14.2)
    4. cocoapods-core (1.14.2, 1.13.0)
    5. cocoapods-deintegrate (1.0.5)
    6. cocoapods-downloader (2.0, 1.6.3)
    7. cocoapods-plugins (1.0.0)
    8. cocoapods-search (1.0.1)
    9. cocoapods-trunk (1.6.0)
    10. cocoapods-try (1.2.0)
    11. colored2 (3.1.2)
    12. ...
    1. // 卸载 cocoapods
    2. sudo gem uninstall cocoapods
    3. // 重新安装
    4. sudo gem install -n /usr/local/bin cocoapods
    • 如果之前已经安装可以安装不成功
    1. // 更新Homebrew
    2. brew update
    3. // 更新最新版本Homebrew
    4. brew update-reset
    5. // 更新Homebrew的package
    6. brew upgrade
    7. // 清除Homebrew缓存
    8. brew cleanup
    9. // 安装ruby
    10. brew install ruby
    11. // 查看可清理的旧版本,不执行实际操作
    12. brew cleanup -n
    13. // 清除ruby 旧版本
    14. brew cleanup ruby
    15. // 安装过后查看ruby版本未改变
    16. echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
    17. source ~/.bash_profile
    1. @HLFdeMacBook-Pro  ~  flutter doctor
    2. Doctor summary (to see all details, run flutter doctor -v):
    3. [✓] Flutter (Channel stable, 3.13.8, on macOS 13.6 22G120 darwin-x64, locale zh-Hans-CN)
    4. [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    5. ✗ cmdline-tools component is missing
    6. Run `path/to/sdkmanager --install "cmdline-tools;latest"`
    7. See <https://developer.android.com/studio/command-line> for more details.
    8. ✗ Android license status unknown.
    9. Run `flutter doctor --android-licenses` to accept the SDK licenses.
    10. See <https://flutter.dev/docs/get-started/install/macos#android-setup> for more details.
    11. [!] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    12. ✗ Unable to get list of installed Simulator runtimes.
    13. [✓] Chrome - develop for the web
    14. [✓] Android Studio (version 2022.3)
    15. [✓] VS Code (version 1.78.1)
    16. [✓] Connected device (2 available)
    17. [✓] Network resources

    Unable to get list of installed Simulator runtimes.

    • Xcode中启动下载ios设备
    1. @HLFdeMacBook-Pro  ~  flutter doctor
    2. Doctor summary (to see all details, run flutter doctor -v):
    3. [✓] Flutter (Channel stable, 3.13.8, on macOS 13.6 22G120 darwin-x64, locale zh-Hans-CN)
    4. [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    5. ✗ cmdline-tools component is missing
    6. Run `path/to/sdkmanager --install "cmdline-tools;latest"`
    7. See <https://developer.android.com/studio/command-line> for more details.
    8. ✗ Android license status unknown.
    9. Run `flutter doctor --android-licenses` to accept the SDK licenses.
    10. See <https://flutter.dev/docs/get-started/install/macos#android-setup> for more details.
    11. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    12. [✓] Chrome - develop for the web
    13. [✓] Android Studio (version 2022.3)
    14. [✓] VS Code (version 1.78.1)
    15. [✓] Connected device (3 available)
    16. [✓] Network resources

    [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3) ✗ cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See macOS install | Flutter for more details.

    • 在android studio 中选则 Android SDK → SDK Tooks → 安装 Android SDK Command-line Tools(latest)
    1. @HLFdeMacBook-Pro  ~  flutter doctor
    2. Doctor summary (to see all details, run flutter doctor -v):
    3. [✓] Flutter (Channel stable, 3.13.8, on macOS 13.6 22G120 darwin-x64, locale zh-Hans-CN)
    4. [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    5. ✗ Flutter requires Android SDK 29 and the Android BuildTools 28.0.3
    6. To update the Android SDK visit <https://flutter.dev/docs/get-started/install/macos#android-setup> for detailed instructions.
    7. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    8. [✓] Chrome - develop for the web
    9. [✓] Android Studio (version 2022.3)
    10. [✓] VS Code (version 1.78.1)
    11. [✓] Connected device (2 available)
    12. [✓] Network resources
    13. ! Doctor found issues in 1 category.

    [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3) ✗ Flutter requires Android SDK 29 and the Android BuildTools 28.0.3 To update the Android SDK visit macOS install | Flutter for detailed instructions.

    • Android Studio -> SDK Manager -> SDK Platforms tab -> 选择 Android 10.0 Pie(SDK 29 对应的是10版本,可能是更高的版本,注意提示要求版本) 下载并安装

    • Android Studio -> SDK Manager -> SDK Tools tab -> 选择右下角 Show Package Details -> 在 Android SDK Build-Tools 里选择 28.0.3 下载并安装

      Untitled

    1. @HLFdeMacBook-Pro  ~  flutter doctor
    2. Doctor summary (to see all details, run flutter doctor -v):
    3. [✓] Flutter (Channel stable, 3.13.8, on macOS 13.6 22G120 darwin-x64, locale zh-Hans-CN)
    4. [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    5. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    6. [✓] Chrome - develop for the web
    7. [✓] Android Studio (version 2022.3)
    8. [✓] VS Code (version 1.78.1)
    9. [✓] Connected device (2 available)
    10. [✓] Network resources

  • 相关阅读:
    rsync远程同步
    C语言:字符串函数(2)
    【Unity脚本】使用脚本操作游戏对象的组件
    小程序源码:修复登录大河盲盒小程序源码,实现运营“玩法自由”,超多功能的盲盒型抽奖挖矿程序源码下载
    软件开发模型与软件测试模型
    5--Linux:文件
    java编程基础总结——16.Object类
    【计算机网络】HTTP协议
    计算机毕业设计(附源码)python-志愿者管理系统
    freertos之资源管理
  • 原文地址:https://blog.csdn.net/SeriousLose/article/details/134096991