Android Studio 构建时卡在 Download maven-metadata.xml...

问题现象:

Android Studio 构建时卡在 Download maven-metadata.xml..._第1张图片

解决办法:

在根目录 build.gradle 中添加阿里云镜像

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        maven { url 'https://maven.aliyun.com/repository/central' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        google()
//        google()
//        mavenCentral()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/central' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/google' }
//        google()
//        mavenCentral()
        maven { url "https://jitpack.io" }
//        maven { url 'https://maven.google.com' }
        maven { url "http://dl.bintray.com/kotlin/kotlin-dev" }
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

你可能感兴趣的:(android-技术英文文献,android,studio)