Im converting my build.gradle
into build.gradle.kts
DSL. So far the conversion was smooth. But im stuck when it comes to flavour dependency before in groovy I used :
nameofflavourImplementation "some.dependency:1.0.0"
i read a lot about how to do this, no luck with this for example:
val nameofflavour by configurations.creating
nameofflavour(group="",name="some.dependency:1.0.0",ext = "aar")
this cause a compile error that the configuration is not known.
Im using gradle: 6.4.1
EDIT:
productFlavors {
create("nameofflavour") {
dimension = "full"
applicationId = "com.someid.android"
}
Anyone can help me here?
Since you're using create("nameofflavour")
, nameofflavour
is registered dynamically. So it needs to be in the scope before dependencies can be declared like this:
val nameofflavourImplementation by configurations
dependencies {
nameofflavourImplementation("some.dependency:1.0.0")
}
OR
You can directly use it as a string:
dependencies {
"nameofflavourImplementation"("some.dependency:1.0.0")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With