原因:
运行时会卡在Running 'gradle assembleDebug, 因为Gradle的Maven仓库在国外, 可以使用阿里云的镜像地址。
解决方法
- 修改项目中 android/build.gradle 文件
//google()
//jcenter()
改成
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的配置文件, 该文件在 Flutter安装目录/packages/flutter_tools/gradle/flutter.gradle
//google()
//jcenter()
改成
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' }