Flutter环境搭建(适合Android开发者)
1.下载sdk,地址如下
https://flutter.dev/docs/development/tools/sdk/releases
下载后,放在任意盘符下,例如E盘,直接解压,得到flutter文件夹
2.配置环境变量 ,path下增加
3.配置镜像
镜像可选地址参考:https://flutter.cn/community/china
以清华的镜像为例
4.修改 E:\flutter\packages\flutter_tools\gradle\flutter.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' }
maven { url 'http://download.flutter.io'}
private static final String DEFAULT_MAVEN_HOST = "https://storage.flutter-io.cn/download.flutter.io";
5.修改 E:\flutter\packages\flutter_tools\gradle\resolve_dependencies.gradle 文件,如下
url "http://download.flutter.io"
6.修改项目 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' }
maven { url 'http://download.flutter.io'}
7.如果遇到gradle下载不下来的情况,自己手动下载
下载地址:https://services.gradle.org/distributions/
下载完之后,为zip,不需要解压,直接放在C:\Users\Yang\.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb
文件夹下,(路径名可能有所变化,套路一样)
8、重启项目,哦了
参考文章
https://www.jianshu.com/p/171a9660e1f9
https://blog.csdn.net/qq_23215957/article/details/107906257
本文地址:https://blog.csdn.net/baidu_33575737/article/details/108162955
推荐阅读
-
android ndk环境搭建详细步骤
-
eclipse搭建android开发环境详细步骤
-
Android开发环境搭建图文教程 亲测有效!
-
JDK Android_SDK Android_Studio Genymotion VirtualBox搭建安卓开发环境
-
Android SDK + Appium 环境搭建
-
Linux下Android开发环境搭建详细步骤
-
ubuntu 12.10 上 android 编译环境搭建的深入解析
-
Linux下Android开发环境搭建的操作方法
-
CentOS Linux系统搭建Android开发环境详细介绍
-
android开发环境搭建详解(eclipse + android sdk)