【问题标题】:Gradle - Could not get unknown property 'scm' for configuration containerGradle - 无法获取配置容器的未知属性“scm”
【发布时间】:2019-09-01 04:47:15
【问题描述】:
Execution failed for task ':app:iterateDeclaredDependencies'.
> Could not get unknown property 'scm' for configuration container of type org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.

我使用来自Working with Dependencies的确切代码sn-p

我不知道这里的 scm 是什么,但自动完成似乎表明一切都很好,不是吗?

我正在使用的版本:

------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------

Build time:   2019-04-26 08:14:42 UTC
Revision:     261d171646b36a6a28d5a19a69676cd098a4c19d

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_191 (Oracle Corporation 25.191-b12)
OS:           Mac OS X 10.14.6 x86_64

【问题讨论】:

    标签: android-studio gradle intellij-idea


    【解决方案1】:

    要查询特定的依赖集,必须先声明它们。 scm 不存在,因此 Gradle 失败并显示错误消息。可以像这样添加额外的依赖集:

    configurations {
        scm
    }
    

    (Defining custom configurations)

    尝试使用其中一种默认值,例如implementation

    我不是 IntelliJ IDEA 用户,因此无法准确说明为什么自动补全在这种情况下有效。

    【讨论】:

      猜你喜欢
      • 2022-11-03
      • 1970-01-01
      • 2021-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-01
      相关资源
      最近更新 更多