Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.2.0)使用阿里镜像

* Error running Gradle:
ProcessException: Process "E:\flutter\demo\flutter_app\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)

> 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 'E:\flutter\demo\flutter_app\android\app\build.gradle' line: 26

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.2.0)
      > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.2.0/kotlin-reflect-1.2.0.jar'.
         > Could not HEAD 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.2.0/kotlin-reflect-1.2.0.jar'.
            > Connect to d29vzk4ow07wi7.cloudfront.net:443 [d29vzk4ow07wi7.cloudfront.net/13.32.253.234, d29vzk4ow07wi7.cloudfront.net/13.32.253.66,
            d29vzk4ow07wi7.cloudfront.net/13.32.253.201, d29vzk4ow07wi7.cloudfront.net/13.32.253.237] failed: Read timed out

* 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 2m 13s
  Command: E:\flutter\demo\flutter_app\android\gradlew.bat app:properties


Please review your Gradle project setup in the android/ folder.

 

    flutter_app/android/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'}
    }

    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'}
        }
    }
在 flutterSDK\flutter\packages\flutter_tools\gradle\flutter.gradle修改

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'
    }
}

 

posted @ 2019-12-10 16:55  dnoyeb  阅读(2872)  评论(0编辑  收藏  举报