我正在将我们基于 Groovy 的脚本迁移到 Kotlin。除了不确定如何为特定风味添加依赖项外,我已经完成了大部分工作。到目前为止,这就是 Kotlin DSL 中的样子,但不确定为什么 freeImplementation("bar:2.2.8")
productFlavors {
create("free") {
...
...
}
create("paid") {
...
...
}
}
dependencies {
implementation("foo:1.2.0")
// This is not working when migrated to Kotlin DSL
freeImplementation("bar:2.2.8")
//Below was the code in Groovy which was working fine earlier
//freeImplementation "bar:2.2.8"
}