Flutter运行环境配置小结
Posted guangdeshishe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Flutter运行环境配置小结相关的知识,希望对你有一定的参考价值。
1.环境变量
FLUTTER_STORAGE_BASE_URL=https://mirrors.tuna.tsinghua.edu.cn/flutter
PUB_HOSTED_URL=https://mirrors.tuna.tsinghua.edu.cn/dart-pub
2.androidStudio运行Android项目一直卡在Running Gradle task 'assembleDebug'...
- 项目/
android/build.gradle
添加阿里镜像repositories maven url 'https://maven.aliyun.com/repository/google' maven url 'https://maven.aliyun.com/repository/jcenter' maven url 'http://maven.aliyun.com/nexus/content/groups/public' allprojects repositories maven url 'https://maven.aliyun.com/repository/google' maven url 'https://maven.aliyun.com/repository/jcenter' maven url 'http://maven.aliyun.com/nexus/content/groups/public'
flutter\\packages\\flutter_tools\\gradle\\flutter.gradle
buildscript repositories maven url 'https://maven.aliyun.com/repository/google' maven url 'https://maven.aliyun.com/repository/jcenter' maven url 'http://maven.aliyun.com/nexus/content/groups/public'
启动web项目白屏问题
原因:pc端的浏览器默认使用canvaskit渲染,改成html方式就可以了
- 1.直接在终端运行命令:
flutter run -d chrome --web-renderer html
- 2.AndroidStudio >
运行
按钮左侧main.dart
下拉选择Edit Configurations
> Additional run args:后面添加--web-renderer html
命令就可以了
以上是关于Flutter运行环境配置小结的主要内容,如果未能解决你的问题,请参考以下文章