一:Flutter环境配置
1:Flutter SDK下载
这里我下载的是flutter_windows_v1.7.8+hotfix.4-beta解压到盘目录E:\flutter
2:环境配置
环境变量新增Path,E:\flutter\bin
3:运行 flutter doctor
打开 windows Powershell,输入flutter doctor
注意:可能会出现android证书问题,根据提示输入flutter doctor --android-licenses 即可,重新执行 flutter doctor
二:Flutter IDE 配置
1:Android Studio或Viual Studio Code下载
2:Android Studio 在File>Setting>Plugins>MarketPlace中搜索Flutter,安装搜索结果第一条,成功后按提示重启
3:Android Studio File>Setting>Languages>Flutter中设置Flutter路径,E:\flutter
4: Android Studio File>Setting>Languages>Dart 中设置Dart SDK,E:\flutter\bin\cache\dart-sdk(第一步已直接设置好,检查即可)
三:工程运行
1:File>New>New Flutter Project
2:修改android>build.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' }
}
}
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' }
}
}
3:运行
注意:如果一直是initializing gradle,可删除C:\Users\xx.gradle\wrapper\dists下的其它文件,不是现在Android使用的gradle版本即可删除。重新运行,看到生成新的文件夹 C:\Users\xx.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv,下载对应版本\gradle-4.10.2-all.zip,下载成功后复制到生成新的文件夹中。
重新运行有点慢,可等待......