mac 安装flutter

206 阅读1分钟
  • 安装Android Studio
  • 安装flutter 官网下载
  • flutter doctor 运行看结果
Xcode - develop for iOS and macOS (Xcode 11.3.1)
   ✗ CocoaPods not installed.
       CocoaPods is used to retrieve the iOS and macOS platform side's plugin
       code that responds to your plugin usage on the Dart side.
       Without CocoaPods, plugins will not work on iOS or macOS.
       For more info, see https://flutter.dev/platform-plugins
     To install:
       sudo gem install cocoapods

运行 sudo gem install cocoapods 之前要运行\curl -sSL https://get.rvm.io | bash -s stable --ruby但是直接运行会报错,要改动一下host里的配置

  • vim /etc/hosts 打开 hosts文件配置199.232.68.133 raw.githubusercontent.com, 199.232.68.133是当前ip 要查看raw.githubusercontent.com的ip到底是什么
  • \curl -sSL https://get.rvm.io | bash -s stable --ruby安装之后根据提示执行操作
  • source /Users/xxx/.rvm/scripts/rvm xxx 是电脑的用户名
  • rvm use ruby-2.7.0
  • sudo gem install cocoapods
  • 打开 Android Studio Android Studio--> Preferences-->plugins 安装flutter即可

  • vscode 中安装flutter插件

大功告成啦