前些日子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. appium--连续滑动

    TouchAction 在之前说过了滑动swip,那种是两点之间的滑动,比如上滑,左滑等.但实际工作中会遇到一些复杂的场景,如九宫格的滑动等待,这时候就要使用TouchAction,TouchActi ...

  2. 牛客CSP-S提高组赛前集训营2 ———— 2019.10.31

    比赛链接 期望得分:100+20+20 实际得分:40+20+30 awa  cccc T1 :基于贪心的思路,然后开始爆搜(雾 那必然是会死的,好吧他就是死了 #include<iostrea ...

  3. [LeetCode] 862. Shortest Subarray with Sum at Least K 和至少为K的最短子数组

    Return the length of the shortest, non-empty, contiguous subarray of A with sum at least K. If there ...

  4. [LeetCode] 88. Merge Sorted Array 混合插入有序数组

    Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: T ...

  5. 遍历 combobox 中的各个选项

    For ii = 0 To cboTCAT.Items.Count - 1 MessageBox.Show(CType(cboTCAT.DataSource, DataTable).Rows(ii). ...

  6. linux查看每秒的网络流量

    import os import time cmd = 'ifconfig | grep "RX bytes" | tail -1 | awk -F":" \' ...

  7. Failed to start LSB: Bring up/down networking 另外一个偏方

    之前网卡启动不了,会是配置不对,或者是移动了虚拟机导致hwaddr发生了变化. 但是今天没改动什么,突然用不了,一直报错Failed to start LSB: Bring up/down .... ...

  8. W5500嵌入式开发

    W5500是韩国一款集成全硬件 TCP/IP 协议栈的嵌入式以太网控制器,W5500同时也是一颗工业级以太网控制芯片,最近发现我们国内也有和W5500 芯片一样芯片 介绍给大家 如下图:

  9. Laravel关联模型中has和with区别

    本篇文章给大家带来的内容是关于Laravel关联模型中has和with区别(详细介绍),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 首先看代码: 1 2 3 4 5 6 $user ...

  10. 元类理解与元类编程 《Python3网络爬虫开发》中第九章代理的使用代码Crawler中代码的理解

    __new__与__init__的理解 __new__()方法是在创建实例之前被调用的,它的作用是创建一个实例,然后返回该实例对象,它是一个静态方法. __init__() 当实例被创建完成之后被调用 ...