인디노트

Android 컴파일시 Duplicate class... found in modules 의 대처법 본문

소스 팁/Java, Android, Kotlin

Android 컴파일시 Duplicate class... found in modules 의 대처법

인디개발자 2022. 10. 9. 21:30

안드로이드 스튜디어에서 컴파일시 다음과 같은 형식의 에러가 발생하면...

Duplicate class org.hamcrest.BaseDescription found in modules hamcrest-core-1.1 (org.hamcrest:hamcrest-core:1.1) and junit-4.10 (junit:junit:4.10)

app 레벨의 build.gradle 에 다음 내용과 같이 넣어주면 된다.

android {
	.
	.
	.	
    configurations.all {
    	resolutionStrategy.dependencySubstitution {
        	substitute module('org.hamcrest:hamcrest-core:1.1') with module('junit:junit:4.10')
	    }
	}    
	.
	.
	.
}
반응형
Comments