更新到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'
}

当前回答

记住这一点

compile 'com.android.support:appcompat-v7:25.2.0'

通过这个

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:mediarouter-v7:25.3.1'

重建和良好编码

其他回答

对于所有情况,不仅仅是这些版本或库:

注意这个小信息窗口,它显示了一些关于错误的信息,其中显示了您必须更改和添加的示例。

在这种情况下:

找到版本25.1.1、24.0.0。示例包括com.android.support:animatedvector-drawable:25.11和com.android.support:mediarouter-v7:24.0.0

Your

support:动画矢量可绘制:25.1.1

是版本25.1.1

com.android.support:mediarouter-v7:24.0.0

版本为24.0.0,因此您必须添加具有相同版本的mediarouter:

com.android.support:mediarouter-v7:25.1.1

对于小信息窗口显示的每个示例,都要这样做,在本例中,所有没有25.1.1版本的库都要这样。

修复指定的库后,必须同步放坡,以查看需要更改的下一个库和包。

重要:如果您没有显式地使用一个或多个指定的库,并且它会给您带来错误,这意味着另一个库正在内部使用它,那么无论如何都要显式地编译它。

您还可以使用另一种方法来查看您实际编译的所有库的版本的差异(例如运行grade依赖关系报告或转到库文件),真正的目的是编译您使用的所有库,使其具有相同的版本。

打开项目的外部库,你会看到一些库仍然使用以前的版本,尽管你没有提到那些库,所以我的建议是只使用特定的库版本,这样可以解决你的问题。

突出显示错误并按“ALT+ENTER”,您将看到一个选项:

添加库依赖项>编辑意图设置

这会将您带到一个菜单,在那里您将看到与支持兼容不同的特定问题支持依赖关系。在gradle(com'XXX')中创建其依赖项,并将其版本设置为与support-compat的版本匹配。同步渐变,你就完成了。

我通过添加

另一件可能导致此问题的事情是,如果您有这样的声明:

compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:+'

那+意味着采用最新版本,可能是比25.3.1更高的版本。将+替换为25.3.1这样的特定版本:

compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'

这将解决问题