无法解析':feature @ debug / compileClasspath'的依赖项:无法解析Gradle插件3.3

时间:2019-03-19 06:18:45

标签: android gradle kotlin

我正在开发具有多个dynamic feature module的应用。但是,当我尝试将gradle插件更新为版本3.3.2时,它总是会失败。

有很多这样的错误消息,例如ERROR: Unable to resolve dependency for ':feature_name@debug/compileClasspath': Could not resolve ...ERROR: Unable to resolve dependency for ':feature_name@release/compileClasspath': Could not resolve ...

它与gradle插件3.2.1一起正常工作。

这是我的项目build.gradle中的gradle插件

dependencies {
    classpath 'com.gradle:build-scan-plugin:1.11'
    classpath 'com.android.tools.build:gradle:3.3.2'
}

我使用gradle包装器4.10.2 gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

这是我的功能build.gradle

apply plugin: 'com.android.dynamic-feature'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion builds.compileSdk
    buildToolsVersion builds.buildTools

    defaultConfig {
        versionCode builds.versionCode
        versionName builds.versionName
        minSdkVersion builds.minSdk
        targetSdkVersion builds.compileSdk
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.11'

    // lifecycle
    implementation 'android.arch.lifecycle:extensions:1.1.1'
    implementation 'android.arch.lifecycle:common-java8:1.1.1'

    implementation 'com.google.android:flexbox:0.3.0'

    implementation project(':app')
    implementation project(':lib_component')
}

我尝试了clean项目,invalidate caches & restart,并删除了.idea.gradle目录,并且脱机工作已经未选中。错误仍然会发生。 not offline

我该怎么做才能更新gradle插件版本?

0 个答案:

没有答案