Android studio 는 JCenter 를 국내 아 리 클 라 우 드 마 븐 으로 일괄 교체 합 니 다.

USER_HOME/.gradle/ 디 렉 터 리 에 파일 을 새로 만 듭 니 다 init.gradle이 단락 의 내용 을 복사 해 넣 어 라.

allprojects{
    repositories {
        def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                    remove repo
                }
            }
        }
        maven {
            url REPOSITORY_URL
        }
    }
}

좋은 웹페이지 즐겨찾기