A problem occurred evaluating project ‘:app’.> Could not resolve all artifacts for configuration ‘classpath’. > Could not find com.android.tools.build:gradle:3.2.1. Searched in the following locations: – https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom – https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.jar – http://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom – http://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.jar Required by: unspecified:unspecified:unspecified

第一步:修改掉项目下的 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’ }

frc b3049bacf33f077b87680c42784e0384 - flutter环境配置问题,启动 flutter项目时报Could not find com.android.tools.build:gradle:3.2.1.

第二步:修改 Flutter SDK 包下的 flutter.gradle 文件

路径根据你的sdk存放位置,例如我的是D:SDKFlutterpackagesflutter_toolsgradleflutter.gradle

同样将 google()和 jcenter() 修改为阿里的链接

maven { url ‘https://maven.aliyun.com/repository/jcenter’ }

maven { url ‘http://maven.aliyun.com/nexus/content/groups/public’ }

frc 3994b91475c390dafe75b644057a8dd1 - flutter环境配置问题,启动 flutter项目时报Could not find com.android.tools.build:gradle:3.2.1.

第三步:若出现下图

frc 90d5a1985fcade3fe998a7f1329bbb1e - flutter环境配置问题,启动 flutter项目时报Could not find com.android.tools.build:gradle:3.2.1.

看到这里说明阿里链接是配置上了的,之所以找不到是因为gradle-3.2.1这个3.2.1版本太高了,应该是最新的

阿里连接中的gradle最高版本好像才3.1.2,所以获取不到

所以,解决办法是将项目下的android目录下的build.gradle文件和flutter SDK包下的flutter.gradle文件中的gradle版本改为阿里镜像中存在的版本

classpath ‘com.android.tools.build:gradle:3.1.2’

frc 91c856d469d369febbef0d5f43109d56 - flutter环境配置问题,启动 flutter项目时报Could not find com.android.tools.build:gradle:3.2.1.

flutter环境配置问题,启动 flutter项目时报Could not find com.android.tools.build:gradle:3.2.1.