DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'. It will be removed in version 5.0 of the Android Gradle plugin. code example

Example 1: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.

android {

    buildFeatures{
         dataBinding = true
         // for view binding :
         // viewBinding = true
    }
}

Example 2: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.

// shorter version
// android.buildFeatures.dataBinding = true


// longer version

android {

  buildFeatures {

         dataBinding = true

         // for view binding:
         // viewBinding = true
    }
}

Example 3: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.

// shorter version
// android.buildFeatures.dataBinding true


// longer version

android {

    buildFeatures {

         dataBinding true

         // for view binding:
         // viewBinding true
    }
}

Tags:

Misc Example