推荐自学网站:
在MAC永久配置相关环境变量:export PATH=${PATH}:/Users/huangrenqian833/Downloads/flutter/bin
/Users/huangrenqian833/Downloads为fullter sdk下载解压后的目录
打开环境配置文件:open -e .bash_profile
检测flutter环境配置:flutter doctor
如果上面命令行有如下警告:
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
打命令行:flutter doctor --android-licenses
然后一直输入y即可。
如果运行APP时报错:Could not download kotlin-compiler-embeddable.jar等需要翻墙下载的,请参考阿里镜像:
flutter错误解决--Error running Gradle 错误