Gradle-无法获取配置容器的未知属性"scm" [英] Gradle - Could not get unknown property 'scm' for configuration container
问题描述
Execution failed for task ':app:iterateDeclaredDependencies'.
> Could not get unknown property 'scm' for configuration container of type org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.
我正在使用使用依赖项中的确切代码段
I'm using the exact code snippet from Working with Dependencies
我不知道 scm 是什么,但是自动补全似乎表明一切都很好,不是吗?
I don't know what scm is here but autocompletion seems to suggests that all is good, no?
我正在使用的版本:
------------------------------------------------------------
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
推荐答案
要查询特定的依赖项集,必须先声明它们. scm
不存在,因此Gradle失败,并显示一条错误消息.可以这样添加其他依赖项集:
To query specific dependency sets, they must be declared first. scm
doesn't exist, thus Gradle fails with an error message. Additional dependency sets can be added like this:
configurations {
scm
}
(定义自定义配置)
尝试使用默认值之一,例如implementation
.
Try with one of the defaults instead, for example implementation
.
我不是IntelliJ IDEA用户,因此无法确切说明为什么在这种情况下自动补全有效.
I'm not an IntelliJ IDEA user, so cannot tell exactly why autocompletion works in this case.
这篇关于Gradle-无法获取配置容器的未知属性"scm"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!