flutter 常见问题

  1. VSCode commond + s Flutter的热重载失效
    原因: 新版的vscode的问题, 下载旧的版本1.31试试就好

下载指定版本

关闭VSCode自动更新

打开code->首选项->用户设置
在打开的settings.json文件中搜索channel
配置是否从更新通道接收自动更新。更改后需要重启。
"update.channel": "default",

2.ERROR: Could not get unknown property 'android' for project ':image_picker' of type org.gradle.api.Project.

删除 /.pub-cache/hosted/pub.dartlang.org 目录中的image_picker,然后运行flutter packages get.
参考:https://github.com/flutter/flutter/issues/24389

3.运行flutter packages get出现提示Waiting for another flutter command to release the startup lock...

删除/flutter/bin/cache/lockfile ,然后重新运行。

4.运行flutter packages get总是卡住不动

vi ~/.bash_profile 

然后添加

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

保存之后运行

source ~/.bash_profile

你可能感兴趣的:(flutter 常见问题)