Flutter安装报错统计

1,003 阅读1分钟

如果有错误或者还有人遇到其他错误,请在评论区一并告知~

1.flutter doctor 报错 -bash: flutter: command not found

vim ~/.bash_profile
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/chengguoshuai/Documents/flutter/bin:$PATH
source ~/.bash_profile
flutter doctor 

2.Downloaded executables cannot execute on host.

$ flutter upgrade

3.Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to remove local changes, then re-run this command with --force.

您的flutter检测有局部变化,将升级回滚清除。如果要保留这些更改,建议您通过“git stash”存储它们,或者将更改提交到本地分支。如果可以的话要删除本地更改,请使用--force重新运行此命令。

$ flutter upgrade --force

4.Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

$ flutter doctor --android-licenses
$ y

5.Oops; flutter has exited unexpectedly. Sending crash report to Google.

$ xcode-select --install 

6.Android license status unknown. Try re-installing or updating your Android SDK Manager. See developer.android.com/studio/#dow… or visit flutter.dev/setup/#andr… for detailed instructions.

在Android Studio 3.6或更高版本中,您需要手动添加旧版本的Android SDK工具才能使Flutter正常工作。

在最新Android Studio下没有Tools这个东西,所以在执行flutter doctor --android-licenses 一直报错,建议下载3.6之前的使用。