Hello, im trying to configure build variants and use variant aware dependency in my project, the pro...
k
Hello, im trying to configure build variants and use variant aware dependency in my project, the problem is gradle isn't recorgnizing "nexgoImplementation" and "paxImplementation", I've synced the project, invalidated caches and what not but gradle says no, i don't know these guys
Copy code
flavorDimensions += "pos_type"
productFlavors {
    create("nexgo") {
        dimension = "pos_type"
        applicationIdSuffix = ".nexgo"
        versionNameSuffix = "-nexgo"
    }
    create("pax") {
        dimension = "pos_type"
        applicationIdSuffix = ".pax"
        versionNameSuffix = "-pax"
    }
}
Copy code
dependencies {

    paxImplementation(
        fileTree(
            mapOf(
                "dir" to "libs", "include" to listOf(
                    "*.jar", "*.so"
                )
            )
        )
    )
nexgoImplementation(
        fileTree(
            mapOf(
                "dir" to "libs", "include" to listOf(
                    "*.aar"
                )
            )
        )
    )
// common dependencies 
}
the weird part is when i try to manually add configurations for the variant implementations like so
Copy code
configurations {
    create("commonImplementation")
    create("nexgoImplementation")
    create("paxImplementation")
}
gradle flags an error saying these configurations cannot be created since there are existing configurations with the same name.. what am i doing wrong here? i'd appreciate your response
c
but it as string like
"nexgoImplementation"(...)
. those variants are not created for the kotlin dsl but there is a n extension function on the string invocation.
k
i appreciate this sir, thanks. Its clear in the documentation and yet i missed it sigh