问题1
在安卓模拟器上运行时,报错提示
Finished with error: ProcessException: Process "/Users/xxx/AndroidStudioProjects/app名称/android/gradlew" exited abnormally:
Downloading https://services.gradle.org/distributions/gradle-4.10.2-all.zip
解决
1、在项目目录gradle — build.gradle — 两处repositories 添加如下镜像地址,并把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' }
2、打开flutter sdk安装目录下的/Users/你的mac用户名/flutter/packages/flutter_tools/gradle/flutter.gradle文件,与上面同样操作,把google()和jcenter()注释,加上上面的镜像地址。
3、如果上面步骤都没解决问题,打开~/.gradle目录下的gradle.properties文件,把代理设置全部注释。
参考
https://segmentfault.com/q/1010000016775662
https://blog.csdn.net/qq_36032597/article/details/89322370