编译报错:
    FAILURE: Build failed with an exception.

    • What went wrong:
      Execution failed for task ‘:app:preDebugBuild’.

    Android dependency ‘androidx.core:core’ has different version for the compile (1.0.0-rc01) and runtime (1.0.0) classpath. You should manually set the same version via DependencyResolution

    build.gradle文件中添加下面subprojects的内容

    buildscript {
    repositories {

    }

    1. dependencies {<br /> classpath 'com.android.tools.build:gradle:3.2.1'<br /> }
    2. // 增加这一段 <br /> subprojects {<br /> project.buildDir = "${rootProject.buildDir}/${project.name}"
    3. project.evaluationDependsOn(':app')
    4. resolutionStrategy.eachDependency { details -><br /> if (details.requested.group == 'com.android.support'<br /> && !details.requested.name.contains('multidex') ) {<br /> details.useVersion "27.1.1"<br /> }
    5. if (details.requested.group == 'androidx.core'<br /> && !details.requested.name.contains('androidx') ) {<br /> details.useVersion "1.0.1"<br /> }<br /> }<br /> } <br />}