flutter官网sdk包:https://flutter.dev/docs/get-started/install
中文网包:https://flutter.cn/docs/get-started/install
配置系统环境变量path:D:\flutterSDK\flutter\bin
是否安装成功。命令行:flutter
检查依赖是否安装:flutter docter
安装android studio:https://developer.android.com/studio/index.html
配置系统变量path:
%JAVA_HOME%\bin;
%JAVA_HOME%\jre\bin;
添加系统变量JAVA_HOME:
C:\Program Files\Java\jdk-15.0.1
启动android studio,打开空白java项目,安装依赖
Android License 异常问题:
Configure -> SDK manager -> Android SDK -> 勾选Android SDK Command-LINE tools(latest)
继续运行 flutter doctor --android-licenses,一路y
为flutter配置国内镜像源(windows):配置系统变量
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
PUB_HOSTED_URL: https://pub.flutter-io.cn
添加模拟器:AVD manager ->
//要下载android内核
查看当前模拟器:flutter emulators
运行模拟器:flutter emulators --launch <模拟器名称>
vs code 安装扩展包:flutter
//会自动安装dart
ctrl + shit + p -> flutter:new application project (创建新项目)
修改项目中,google仓库地址为阿里云地址:android -> build.gradle
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‘ }
右下角选择设备,运行和调试
入口文件 lib -> main.dart,修改部分内容,实时更新