赞
踩
可以在build.gradle中buildscript -> repositories 代码块添加以下代码进行配置。
- buildscript {
- repositories {
- maven { url 'https://maven.aliyun.com/repository/google' }
- maven { url 'https://maven.aliyun.com/repository/public' }
- maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
- google()
- mavenCentral()
- }
- }
-
- allprojects {
- repositories {
- maven { url 'https://maven.aliyun.com/repository/google' }
- maven { url 'https://maven.aliyun.com/repository/public' }
- maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
- google()
- jcenter()
- }
- }
如果在build.gradle没有找到buildscript -> repositories 代码块,可以在settings.gradle配置
- pluginManagement {
- repositories {
- maven { url 'https://maven.aliyun.com/repository/google' }
- maven { url 'https://maven.aliyun.com/repository/public' }
- maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
- google()
- mavenCentral()
- }
- }
-
- dependencyResolutionManagement {
- repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
- repositories {
- maven { url 'https://maven.aliyun.com/repository/google' }
- maven { url 'https://maven.aliyun.com/repository/public' }
- maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
- google()
- jcenter()
- maven {
- url "https://jitpack.io"
- }
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。