Error - This support library should not use a different version (23) than the compileSdkVersion (26)

CODEDRAGON Development/Android

반응형


 

 

오류메시지

This support library should not use a different version (23) than the compileSdkVersion (26) more... (Ctrl + F1)


 

 

 


해결방법

v4의 버전도 현재 targetSDK버전과 동일하게 모두 같은 버전을 사용해주어야 합니다. 26(Oreo)를 쓴다면 아래와 같이 추가합니다.

해결 전

dependencies{

implementationfileTree(include:['*.jar'],dir:'libs')

implementation'com.android.support:appcompat-v7:26.1.0'

implementation'com.android.support.constraint:constraint-layout:1.0.2'

testImplementation'junit:junit:4.12'

androidTestImplementation'com.android.support.test:runner:1.0.1'

androidTestImplementation'com.android.support.test.espresso:espresso-core:3.0.1'

implementation'com.android.support:support-v4:23.+'

}

해결 후

 

dependencies{

implementationfileTree(include:['*.jar'],dir:'libs')

implementation'com.android.support:appcompat-v7:26.1.0'

implementation'com.android.support.constraint:constraint-layout:1.0.2'

testImplementation'junit:junit:4.12'

androidTestImplementation'com.android.support.test:runner:1.0.1'

androidTestImplementation'com.android.support.test.espresso:espresso-core:3.0.1'

implementation'com.android.support:support-v4:26.+'

 

}