解决AS依赖下载不了的问题

在C盘的C:\Users\用户名\.gradle文件夹下新建init.gradle文件,

allprojects {
    buildscript.repositories {
        maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }
		maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
		maven { url 'https://maven.google.com/'}
    }
    buildscript.configurations.all {
        resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    repositories {
        maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }
		maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
		maven { url 'https://maven.google.com/'}
    }
    configurations.all {
        resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
}

你可能感兴趣的:(解决AS依赖下载不了的问题)