Android支持库必须使用完全相同的版本

Android支持库必须使用完全相同的版本,android,Android,请问,这个梯度代码有什么问题,我该如何修复它 我认为这是一个支持库与支持库不兼容的问题,但我不知道如何修复它 下面是app build.grade文件的完整内容 apply plugin: 'com.android.application' apply plugin: 'com.google.firebase.firebase-crash' android { signingConfigs { config_release { keyAlias

请问,这个梯度代码有什么问题,我该如何修复它

我认为这是一个支持库与支持库不兼容的问题,但我不知道如何修复它

下面是app build.grade文件的完整内容

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'

android {
    signingConfigs {
        config_release {
            keyAlias 'xx'
            keyPassword 'xx'
            storeFile file('xx')
            storePassword 'xx'
        }
    }
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "xx"
        minSdkVersion 15
        targetSdkVersion 27

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config_release
            minifyEnabled true
        }
    }

    flavorDimensions "tier"

    productFlavors {
        pay {
            applicationId 'xx'
            versionCode 1
            versionName "1.0"
            dimension "tier"
        }
        free {
            applicationId 'xx'
            versionCode 20
            versionName '2.11'
            dimension "tier"
        }
    }
}
dependencies {
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.google.android.gms:play-services-plus:15.0.1'
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
    implementation('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar') {
        transitive = true
    }

    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-crash:16.0.1'
    freeImplementation 'com.google.firebase:firebase-ads:15.0.1'
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.android:flexbox:0.3.2'
}
应用插件:“com.google.gms.googleservices”
提前感谢。

您必须使用提示中显示的较低版本替代每个库,而使用较高版本。(与提示中显示的相同,27.1.1在您的案例中)

例如,您在提示
com.android.support:customtabs:26.1.0

因此,在dependencies块中添加
'com.android.support:support:customtabs:27.1.1'
,使用更高版本27.1.1,而不是26.1.0

implementation 'com.android.support:support-media-compat:27.1.1'

重复此操作直到警告消失,在

之后,其他库中可能会出现其他警告,尽管出现IDE错误,代码是否仍正常生成?该问题通常只是一个警告。这可能是因为RecyclerView依赖项在其自身中使用了一些不同的版本。添加了实现'com.android.support:customtabs:27.1.1',问题已得到修复。