Search code examples
kotlingroovyandroid-viewbinding

What's the difference between viewBinding enabled true and buildfeatures viewBinding true


What's the difference between the options to enable viewBinding:

viewBinding {
    enabled = true
}

AND

Groovy

buildFeatures {
    viewBinding true
}

Kotlin

buildFeatures {
    viewBinding = true
}

Solution

  • viewBinding {
        enabled = true
    }
    

    this used to be used and now some users are seeing error

    buildFeatures {
        viewBinding = true
    }
    

    they are using this. But there is no difference in terms of usage.