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

Minji Jeong·2022년 5월 9일
0

Troubleshooting

목록 보기
2/20
post-thumbnail

문제


프로젝트 수준의 build.gradle에서 아래와 같이 레포지토리를 등록하고 sync 할 시 오류가 발생했다.

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

해결

나는 안드로이드 스튜디오 Bumblebee 버전을 사용하고 있다. Arctic Fox 이후 버전에서 생성된 프로젝트는 프로젝트 수준 build.gradle이 아닌 settings.gradle에 필요한 레포지토리를 등록해야한다.

dependencyResolutionManagement {
    ...
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

Reference

https://ideajini.tistory.com/15

profile
Mobile Software Engineer

0개의 댓글