Hi everyone, I am trying to do some custom logic f...
# gradle
d
Hi everyone, I am trying to do some custom logic for each build variant. I am trying to use the new
onVariants
API, but it is not working, throwing
groovy.lang.MissingMethodException
. The below snippet contains the code which I have added to my
app/build.gradle
-
Copy code
plugins {
    //...
}

android {
    //...
}

androidComponents {
    onVariants { variant ->

    }
}
c
perhaps convert the build script to Kotlin (this is a Kotlin slack channel!) and benefit from code completion, improved error messages, etc.
t
onVariant
API has been added recently in the Android Gradle Plugin. Check that you are using AGP version 7.0.0 or newer.