1.下载SDK去官网
2.android studio插件下载
分别下载安装flutter描件和dart
3.配置Flutter环境变量及国内镜像
1.打开 open -e .bash_profile ���
2.添加路径 export PATH=${PATH}:/Users/mac/development/flutter/bin
3.假如不生效的话,配置到~/.zshrc文件里
3.刷新 source ~/.zshrc
4.flutter doctor 检查 遇到x就根据提示一步步改正
5.flutter doctor --android-licenses 得到证书同意.zshrc文件
--------------------------------------------------------------------------------------
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=${PATH}:/Users/mac/development/flutter/bin
source ~/.bash_profile
---------------------------------------------------------------------------------------
6.重新打开窗口看是否生效: echo $PATH
4.如果AS创建工程一直卡住 可以使用命令方式尝试
1. 命令创建Flutter app 工程:
flutter create [项目名称]
flutter create xxapp//默认Android使用Java,iOS使用Objective-C。
flutter create -i swift -a kotlin xxapp //如果要指定语言,比如安卓使用Kotlin,iOS使用Swift
2. 命令创建Flutter Module:
flutter create -t module xxapp_module
5.问题解决:
1. Waiting for another flutter command to release the startup lock…:
执行命令删除文件 :rm -rf /Users/mac/development/flutter/bin/cache/lockfile2.点击Pub卡诠:�
命令包的获取: flutter pub get3.Running Gradle task 'assembleDebug'...
flutter 卡在Running Gradle task 'assembleDebug'... - 诗意的活着 - 博客园