更新了flutter1.12.13+hotfix.5,结果编译时总是报各种的Android编译版本错误

Android dependency 'androidx.drawerlayout:drawerlayout' 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

↑大概就是这样的错误,每次报错的API都不一样,但是除了API其他的都是一样的。求有没有大佬指点一下。

另,build.gradle里代码是这样的:

buildscript {
    ext.kotlin_version = '1.3.41'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')

    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.1.1"
            }else if(details.requested.group == 'androidx.lifecycle')
            {
                details.useVersion "2.0.0-rc01"
            }else if(details.requested.group == 'androidx.versionedparcelable')
            {
                details.useVersion "1.0.0-rc01"
            }else if(details.requested.group == 'androidx.core')
            {
                details.useVersion "1.0.0-rc01"
            }
            else if (details.requested.group == 'androidx.asynclayoutinflater' &&
                    !details.requested.name.contains('androidx')) {
                details.useVersion "1.0.0"
            }
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
阅读 1.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题