我统一了AndroidGradle版本,但是弹出"mixing version"

I unified the Android Gradle version, but "mixing version" pops up

程序会运行正常。 但是通过删除错误标记,我想防止潜在的危险。

我的targetSdkVersion是26。 所以我把所有 Gradle 的版本都统一成了26。 但是,Android 工作室警告说 25.2.0 仍然存在并且它是一个混合版本。然而,我怎么看都没有看到25.2.0.

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). 
Found versions 26.1.0, 25.2.0. Examples include com.android.support:animated-vector-drawable:26.1.0 and com.android.support:mediarouter-v7:25.2.0

There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version(or in particular, a version lower than your targetSdkVersion.)


怎么找都找不到'Gradle Version 25'。而且我在警告中找不到 "com.android.support:mediarouter-v7:25.2.0" 。为什么会冒出这句话?

(弹出错误:执行 'com.android.support:appcompat-v7:26.1.0')


apply plugin: 'com.android.application'

android {

    signingConfigs {
        release {
            keyAlias 'key'
            keyPassword 'abcde'
            storeFile file('C:/Users/aaaa/.AndroidStudio2.3/key.jks')
            storePassword 'aaaaaaa'
        }
    }


    compileSdkVersion 26

    defaultConfig {

        applicationId "com.example.aaaaa.abcde"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        multiDexEnabled true
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion '26.0.2'


    productFlavors {
    }
}

dependencies {
    compile 'com.android.support:multidex:1.0.1'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26.1.0'
    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'


    // Login php Connect
    compile 'com.android.volley:volley:1.0.0'
    implementation 'com.google.android.gms:play-services:11.8.0'




    // Open source plus
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile group: 'com.kakao.sdk', name: 'kakaolink', version: project.KAKAO_SDK_VERSION
    compile project(':airquality-release')
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile "com.github.katoro:typekit:1.0.1"  
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:26.1.0'
    testCompile 'junit:junit:4.12'
}

我查看了 Gradle 子文件夹中的所有其他文件,但找不到 25 踪迹。 (除了下面附上的代码外,还有其他文件,但我没有附上,因为它是大约10行短代码。)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

// Open source plus
subprojects {
    repositories {
        mavenCentral()
        maven { url 'http://devrepo.kakao.com:8088/nexus/content/groups/public/' }
    }
}

allprojects {
    repositories {
        // Open source plus
        maven { url 'https://jitpack.io' }
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

使您的 build.gradle(Module:project) 像下面的代码一样....

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

并使您的 build.gradle(Module:app) 像下面的代码一样,您可以添加自己有用的依赖项并删除我未使用的依赖项。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "talent4assure.com.manageyourrestaurant"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 4
        versionName "1.0.3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_7
        sourceCompatibility JavaVersion.VERSION_1_7
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26.1.0'
    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'
    compile 'com.android.support:design:26.+'
    compile 'com.android.support:cardview-v7:26.+'
    compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
    compile 'de.hdodenhof:circleimageview:2.2.0'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.squareup.okhttp3:okhttp:3.5.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.karumi:dexter:4.2.0'
    compile 'id.zelory:compressor:2.1.0'
    compile 'de.hdodenhof:circleimageview:2.2.0'
}