问题描述
将targetSdkVersion更新为27后,我收到此错误消息。
After updating targetSdkVersion to 27 I got this error message.
我知道我应该更新 com.android.support: support-media-compat
但我不知道怎么做,因为我没有在build.gradle中使用它,我试图更新SDK工具,但问题仍然存在。波纹管是build.gradle:
I understand that I should update com.android.support:support-media-compat
but I dont know how because I am not using it in build.gradle , I tried to update SDK tools but the problem is still remaining . bellow is build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.ex"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.2'
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.google.android.gms:play-services-ads:11.6.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.bloder:magic:1.1'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
}
推荐答案
我已经手动检查了项目中的库-> .myidea->库,然后发现我有两个使用旧版本的库:
I have checked manually the libraries in project -> .myidea-> libraries then I found that I have two libraries using the old version :
然后只需在builde.gradle中添加此行
then just by adding this line in builde.gradle
错误现在消失了。
这篇关于所有com.android.support库都必须使用完全相同的版本规范:27.0.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!