[Android Studio] Solution - Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See ht..

|




아무 짓도 안했는데... 새 프로젝트를 만들자마자 다음과 같은 에러가 떴다.


Error:Execution failed for task ':app:preDebugAndroidTestBuild'.

> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.


해결방법:


build.grade(Module:app)에서 dependencies 안에

implementation 'com.android.support:support-annotations:27.1.1'

와 같이 넣어준다.


다음과 같은 모습일 것이다.

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-annotations:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

참고: https://stackoverflow.com/questions/50117626/conflict-with-dependency-com-android-supportsupport-annotations-in-project

And