在将targetSdkVersion更新为27之后,我遇到了这个错误消息。
所有的com.android.support库都必须使用完全相同的版本规范(混合版本可能会导致运行时崩溃)。发现版本27.0.2、25.2.0。例如:
com.android.support:animated-vector-drawable:27.0.2
和com.android.support:support-media-compat:25.2.0
我知道我应该更新com.android.support:support-media-compat
,但我不知道怎么更新,因为我在build.gradle中没有使用它,我尝试更新SDK工具,但问题仍然存在。下面是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'
}
gradlew app:dependencies --configuration releaseCompileClasspath
。 - DeKaNszn