viewbinding:android.defaults.buildfeatures 与 buildFeatures{}?

viewbinding: android.defaults.buildfeatures vs. buildFeatures{}?

提问人:JDOaktown 提问时间:10/31/2023 最后编辑:JDOaktown 更新时间:10/31/2023 访问量:20

问:

两者之间有什么区别:

 android.defaults.buildfeatures.viewbinding=true 

在 gradle.properties 中

与。

 buildFeatures{ viewBinding true }

在 app build.gradle.kts 中

?

前者比后者更受欢迎吗?

Android Studio 中的弹出文本:

Flag to enable View Binding.
Setting the value to null resets to the default value. Default value is false.
You can override the default for this for all projects in your build by adding the line android.defaults.buildfeatures.viewbinding=true in the gradle.properties file at the root project of your build.
More information about this feature at: TBD
gradle-kotlin-dsl android-viewbinding gradle.properties

评论


答: 暂无答案