Android Studio in Gradle Sync synchronization solution to the problem of slow

Android studio update to 3.3.1, after completion, gradle sysnc been synchronized, after one hour was still going round in circles. Slow synchronization can not stand.

How to solve a search online and found Ali cloud has a mirror, only you need to add the appropriate url address to download. As shown in gradle scripts-> build gradle. Open the file.

buildscript {
    
    repositories {
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        jcenter()
    }
}

Note: Adding a maven {url 'http://maven.aliyun.com/nexus/content/groups/public/'}, do not google () and
jcenter () masked, I began to put two commented simply can not be synchronized.

 

Original http://www.wangluoshenghuo.com/2019/02/15/android-studio%E9%87%8Cgradle-sync%E5%90%8C%E6%AD%A5%E6%85%A2%E9%97 % AE% E9% A2% 98% E7% 9A% 84% E8% A7% A3% E5% 86% B3% E6% 96% B9% E6% B3% 95 /

Guess you like

Origin www.cnblogs.com/zxdplay/p/11309101.html