본문 바로가기

ISSUE

[Android] Build was configured to prefer settings repositories over project repositories but repository '@@' was added by build file 'build.gradle'

안드로이드 일정 버전 이상에서는 라이브러리를 추가할 경우 이런 오류가 뜬다.

build.gradle이 아닌 settings.gradle에 추가하면 된다

 

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url 'https://naver.jfrog.io/artifactory/maven/'
        }
        maven {
            url 'https://jitpack.io'
        }
    }
}

jitpack.io를 위와 같이 추가하자 문제 없이 sync!