'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27...

'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.0.1) classpath

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.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
}
//这段是重点
subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.1.0"
            }
        }
    }
}

你可能感兴趣的:('com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27...)