无法将原因分配给依赖项

Cannot assign reason to dependency

我尝试将 reason 添加到依赖项中,例如:

implementation("foo:bar:0.1.0") { reason = "test" }

但是得到一个错误,指出"val cannot be reassigned"。 我找不到我从中得到这个的来源,但从我的记忆中就是这样。我做错了什么?

根据 https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:documenting-dependencies 中的示例,它看起来应该是

implementation("foo:bar:0.1.0") { because("test") }