Gets following warning when building the project
DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
I am using Android Studio Canary 6
Kotlin Android Extensions is deprecated, which means that using Kotlin synthetics for view binding is no longer supported.
The Data Binding Library is a support library that allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically. Layouts are often defined in activities with code that calls UI framework methods.
DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'. の解消 Android Studio4.0にバージョンアップしてからコンパイルした際に以下のようなwarningが出ていた。 Copied! DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'. の解消 - Qiita DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'. の解消 - Qiita DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'. の解消 Android Studio4.0にバージョンアップしてからコンパイルした際に以下のようなwarningが出ていた。 Copied!
DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'. It will be removed in version 7.0 of the Android Gradle plugin. DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
Starting from Android Gradle Plugin 4.0.0-alpha05
there is a new block called buildFeatures
to enable build features.
So in order to enable databinding with new AGP plugin you have do like following in module (ex: app) level gradle file
build.gradle ( Groovy DSL )
// shorter version
// android.buildFeatures.dataBinding true
// longer version
android {
buildFeatures {
dataBinding true
// for view binding:
// viewBinding true
}
}
build.gradle.kts ( Kotlin DSL )
// shorter version
// android.buildFeatures.dataBinding = true
// longer version
android {
buildFeatures {
dataBinding = true
// for view binding:
// viewBinding = true
}
}
Reference: https://developer.android.com/studio/releases/gradle-plugin#buildFeatures
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