发布:2023/12/7 15:42:03作者:大数据 来源:大数据 浏览次数:434
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.example.viewmodelbindingdemo1" minSdkVersion 28 targetSdkVersion 30 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" dataBinding{ enabled true } ...代码略 |
错误异常:
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.
Affected Modules: app
属性已经被buildFeatures重新定义。
DSL元素的android.dataBinding。已被替换为“android.buildFeatures.dataBinding”,它将在5.0版的Android Gradle插件中被删除。
适用于多个属性:
1 2 3 |
buildFeatures{ dataBinding true } |
或
1 2 3 |
buildFeatures{ dataBinding=true } |
或单个属性可以这样:
1 |
buildFeatures.dataBinding true |
或
1 |
buildFeatures.dataBinding=true |
总结,多个属性用{}来表示,可以用=或空格,单个属性可以用.来连接属性。
© Copyright 2014 - 2024 柏港建站平台 ejk5.com. 渝ICP备16000791号-4