前些日子google推出Flutter1.9版本支持web果断升级

在运行flutter时发现错误,错误提示为

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process exited abnormally: > Configure project :app Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error. FAILURE: Build failed with an exception. * Where:
Build file '/Users/haishun/project/phoneapp/myapp/android/app/build.gradle' line: 25 * What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
> Could not resolve com.android.tools.build:gradle:3.5.0.
Required by:
unspecified:unspecified:unspecified
> Could not resolve com.android.tools.build:gradle:3.5.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> dl.google.com:443 failed to respond
> Could not resolve com.android.tools.build:gradle:3.5.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> jcenter.bintray.com:443 failed to respond * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 0s
Command: /Users/haishun/project/phoneapp/myapp/android/gradlew app:properties Finished with error: Please review your Gradle project setup in the android/ folder.

可以看出会连接google服务,因GWF原因我们修改为阿里云

buildscript {
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' }
} dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
} allprojects {
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' }
}
}

修改以上代码,再次运行flutter run

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.2.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.2.1.
> Could not get resource 'https://maven.aliyun.com/repository/google/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Could not HEAD 'https://maven.aliyun.com/repository/google/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused (Connection refused)
> Could not resolve com.android.tools.build:gradle:3.2.1.
> Could not get resource 'https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Could not HEAD 'https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused (Connection refused)
> Could not resolve com.android.tools.build:gradle:3.2.1.
> Could not get resource 'http://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Could not HEAD 'http://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
> Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused (Connection refused)

再度提示我们同样的错误,127.0.0.1:1080,好像没有设置这个代理,去项目目录下android/gradle.properties查看该文件发现并无代理设置

同样打开全局配置文件,Windows在个人文档目录下,Mac/*nix在用户目录下.gradle/gradle.properties打开发现

存在代理配置将其删除即可

Flutter gradle采坑的更多相关文章

  1. Flutter 开发填坑指南

    引言 第一次在使用Flutter是在Ubuntu机器上,但是因为Android Studio还有Sdk配置问题,flutter doctor总是在这一步报错...最近又在win10上配了一下环境(真香 ...

  2. Cloudera Manager 5.9 和 CDH 5.9 离线安装指南及个人采坑填坑记

    公司的CDH早就装好了,一直想自己装一个玩玩,最近组了台电脑,笔记本就淘汰下来了,加上之前的,一共3台,就在X宝上买了CPU和内存升级了下笔记本,就自己组了个集群. 话说,好想去捡垃圾,捡台8核16线 ...

  3. angular采坑记录

    在angular中会遇到一些莫名的问题,导致不能完成想要的功能,可能是某项用法使用错误,或许是angular相对应不支持,或者是我们功力根本就没有达到.为了在每次采坑之后能有所收获,再遇到时能理解其根 ...

  4. 分布式改造剧集之Redis缓存采坑记

    Redis缓存采坑记 ​ 前言 ​ 这个其实应该属于分布式改造剧集中的一集(第一集见前面博客:http://www.cnblogs.com/Kidezyq/p/8748961.html),本来按照顺序 ...

  5. 采坑:python base64

    需求:  读取文本内容,对字符串进行base64加密 >>> str = 'aaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbbbbbbbbb\nccc ...

  6. Hadoop环境搭建--Docker完全分布式部署Hadoop环境(菜鸟采坑吐血整理)

    系统:Centos 7,内核版本3.10 本文介绍如何从0利用Docker搭建Hadoop环境,制作的镜像文件已经分享,也可以直接使用制作好的镜像文件. 一.宿主机准备工作 0.宿主机(Centos7 ...

  7. Spring Cloud Config采坑记

    1. Spring Cloud Config采坑记 1.1. 问题 在本地运行没问题,本地客户端服务能连上本地服务端服务,可一旦上线,发现本地连不上线上的服务 服务端添加security登录加密,客户 ...

  8. rabbitmq在ios中实战采坑

    1. rabbitmq在ios中实战采坑 1.1. 问题 ios使用rabbitmq连接,没过多久就断开,并报错.且用android做相同的步骤并不会报错,错误如下 Received connecti ...

  9. 从源码看Spring Security之采坑笔记(Spring Boot篇)

    一:唠嗑 鼓捣了两天的Spring Security,踩了不少坑.如果你在学Spring Security,恰好又是使用的Spring Boot,那么给我点个赞吧!这篇博客将会让你了解Spring S ...

随机推荐

  1. 关于c# 中读取系统内存大小的问题。

    在程序中,调用WMI的时候,出现一个问题,就是我系统有插了两条内存条,共4G.然而自己只能在程序中查到安装内存为2G,感觉有点不淡定.这是之前的代码. static ManagementObjectS ...

  2. CentOS7 部署nfs服务

    参考博客 参考博客 https://blog.51cto.com/addam/1576144 错误1: 客户端挂载nfs报错mount: wrong fs type, bad option, bad ...

  3. 11/5 <backtracking> 伪BFS+回溯

    78. Subsets While iterating through all numbers, for each new number, we can either pick it or not p ...

  4. 11/4 <LinkedList>

    82. Remove Duplicates from Sorted List II 跳过重复节点,返回head. class Solution { public ListNode deleteDupl ...

  5. 牛客CSP-S提高组赛前集训营1———2019.10.29 18:30 至 22:00

    期望得分:100+0+10 实际得分:40+0+0 考炸了... T1:题目链接 究竟为什么会这样,,, 仔细研读我的丑代码 发现... 枯辽.... #include<cstdio> # ...

  6. [LeetCode] 241. Different Ways to Add Parentheses 添加括号的不同方式

    Given a string of numbers and operators, return all possible results from computing all the differen ...

  7. python read readline readlines区别

    file 对象使用 open 函数来创建,下表列出了 file 对象常用函数read.readline.readlines区别: 1.从文件读取指定的字节数,size如果未给定或为负则读取所有. fi ...

  8. 一个网页从输入URL到页面加载完成的过程中都发生了什么事情?

    这是一个前端的经典面试题,很多大公司面试时都会被问及,涉及的面也是非常多. 一般会经历以下几个过程: 1.首先,在浏览器地址栏中输入url 2.浏览器先查看浏览器缓存-系统缓存-路由器缓存,如果缓存中 ...

  9. LeetCode 561:数组拆分 I Array Partition I

    文章全部来自公众号:爱写bug 算法是一个程序的灵魂. Given an array of 2n integers, your task is to group these integers into ...

  10. Tomcat基础操作

    1.在WebApps ROOT目录里,如果删除过ROOT从新创建,放置index.html,index.jsp即可访问. 2.修改默认8080端口,打开server.xml,将8080端口修改为80即 ...