gradle依赖关系更新失败

时间:2018-11-14 09:51:27

标签: gradle android-gradle dependencies

我已经“安装”或包含了ben manes-gradle版本插件:

https://github.com/ben-manes/gradle-versions-plugin

下面的代码是build.gradle(项目:奖励)

应用插件:“ com.github.ben-manes.versions”

buildscript {
    ext.kotlin_version = '1.3.10'
    repositories {
        google()
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

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

当我尝试运行以下gradle任务时: gradledependencyUpdates

我得到以下信息:

FAILURE: Build failed with an exception.
 What went wrong:
Task 'gradle' not found in project ':app'. Some candidates are: 'bundle'.
 Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
 Get more help at https://help.gradle.org
BUILD FAILED in 0s
11:23:53: Tasks execution finished 'gradle dependencyUpdates'.

1 个答案:

答案 0 :(得分:0)

经过进一步测试,我意识到我需要运行的任务前面不应有gradle这个词。命令行说明应该只是 dependencyUpdates 。然后单击“确定”,它将导出报告。

enter image description here