更新到android studio 2.3后,我收到了这个错误消息。我知道这只是一个提示,因为应用程序运行正常,但这真的很奇怪。

所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本25.1.1、24.0.0。示例包括com.android.support:animatedvector-drawable:25.1.1和com.android.com/support:mediarouter-v7:24.0.0

我的成绩:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:support-v4:25.1.1'
    compile 'com.android.support:design:25.1.1'
    compile 'com.android.support:recyclerview-v7:25.1.1'
    compile 'com.android.support:cardview-v7:25.1.1'
    compile 'com.google.android.gms:play-services-maps:10.2.0'
    compile 'com.google.android.gms:play-services:10.2.0'

    compile 'io.reactivex.rxjava2:rxjava:2.0.1'
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    compile 'com.jakewharton:butterknife:8.4.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
    compile 'com.blankj:utilcode:1.3.6'
    compile 'com.orhanobut:logger:1.15'
    compile 'com.facebook.stetho:stetho:1.4.2'

    provided 'com.google.auto.value:auto-value:1.2'
    annotationProcessor 'com.google.auto.value:auto-value:1.2'
    annotationProcessor 'com.ryanharter.auto.value:auto-value-parcel:0.2.5'

    compile 'com.mikepenz:iconics-core:2.8.2@aar'
    compile('com.mikepenz:materialdrawer:5.8.1@aar') { transitive = true }
    compile 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
    compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
    compile 'com.github.GrenderG:Toasty:1.1.1'
    compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.8.0'
    compile 'com.github.MAXDeliveryNG:slideview:1.0.0'

    compile 'com.facebook.fresco:fresco:1.0.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'

    compile 'com.google.maps.android:android-maps-utils:0.4.4'
    compile 'com.github.jd-alexander:library:1.1.0'
}

当前回答

使用新版本的android studio 3.x非常简单。

只需复制低于当前版本的版本,然后使用与当前版本相同的版本号显式添加。

实例

找到版本27.1.1、27.1.0。示例包括com.android.support:animatedvector-drawable:27.1.1和com.android.com/support:exifinterface:27.1.0

只需复制版本com.android.support:exifinterface:27.1.0并将其更改为com.android.com/support:exifinterface:227.1.1,使其与当前使用的版本相同,然后将其添加到gradle依赖项中,如下所示。

implementation 'com.android.support:exifinterface:27.1.1'

注意:完成后,不要忘记单击编辑器顶部的“立即同步”。

其他回答

在2018年更新此错误时,从项目结构中添加实现

implementation 'com.android.support:support-v13:28.0.0'

在项目模式-->外部库中,您可以在那里找到问题所在我正在使用版本28和我找到的外部库support:support-media-compat-26.0.0,这是错误。

实施后支持v13并正在运行

将以下实现语句添加到依赖项部分。(如果它显示一些App Compat库不匹配错误,那么我们必须重新实现所有不匹配的支持库。我们可以通过将光标放在错误上找到不匹配的库。按快捷键ctrl+F1在android studio中显示完整的详细信息。)

implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support:asynclayoutinflater:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'

使用新版本的android studio 3.x非常简单。

只需复制低于当前版本的版本,然后使用与当前版本相同的版本号显式添加。

实例

找到版本27.1.1、27.1.0。示例包括com.android.support:animatedvector-drawable:27.1.1和com.android.com/support:exifinterface:27.1.0

只需复制版本com.android.support:exifinterface:27.1.0并将其更改为com.android.com/support:exifinterface:227.1.1,使其与当前使用的版本相同,然后将其添加到gradle依赖项中,如下所示。

implementation 'com.android.support:exifinterface:27.1.1'

注意:完成后,不要忘记单击编辑器顶部的“立即同步”。

解决冲突的另一种方法是强制所有依赖项使用正确的版本,如下所示:

dependencies {
            configurations.all {
                resolutionStrategy.eachDependency { DependencyResolveDetails details ->
                    if (details.requested.group == 'com.android.support' && details.requested.name == 'support-v4') {
                        details.useVersion "27.0.2"
                    }
                }
    ...
    }

https://docs.gradle.org/current/userguide/customizing_dependency_resolution_behavior.html

您已经定义了要用24.0.0版而不是25.1.1版编译的任何其他依赖项。请将所有依赖项的版本设置为与25.1.1相同。