一、报错 google自行搜索

  1. // 我的报错
  2. buildscript {
  3. # kotlin版本号过低
  4. ext.kotlin_version = '1.3.21'
  5. repositories {
  6. google()
  7. jcenter()
  8. }
  9. dependencies {
  10. # gradle版本号过低
  11. classpath 'com.android.tools.build:gradle:3.2.1'
  12. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  13. }
  14. }

二、连接超时,jar包下载

  1. //1.改变文件
  2. C:\flutter\packages\flutter_tools\gradle\flutter.gradle
  3. repositories {
  4. maven { url 'https://maven.aliyun.com/repository/google' }
  5. maven { url 'https://maven.aliyun.com/repository/jcenter' }
  6. maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
  7. }

image.png

  1. //2.改变 build.gradle中的文件
  2. repositories {
  3. // google()
  4. // jcenter()
  5. maven { url 'https://maven.aliyun.com/repository/google' }
  6. maven { url 'https://maven.aliyun.com/repository/jcenter' }
  7. maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
  8. }

image.png

三、gradle版本问题

  • 5.xx

image.png