问题描述
如文档.
我想禁用此功能,因为我们使用DataBinding而不是Kotlin合成视图属性,有时我会无意中导入它们;还会为我们不使用的东西增加额外的构建开销.
I would like to disable this feature, because we use DataBinding instead of the Kotlin synthetic view properties, and sometimes I import them by accident; also it adds extra build overhead for something we don't use.
无法禁用Android扩展插件,因为我们使用了由同一插件完成的Parcelize功能.
Disabling the Android extensions plugin is not possible, because we use the Parcelize feature which is done by the same plugin.
推荐答案
androidExtensions
DSL中有一个features
属性,可让您提供要启用的功能列表.当前,只有两个可用,parcelize
和views
.要禁用综合视图属性,请将其添加到您的build.gradle
:
There is a features
property in the androidExtensions
DSL that allows you to provide a list of features to enable. Currently, there is only two available, parcelize
and views
. To disable synthetic view properties, add this to your build.gradle
:
androidExtensions {
features = ["parcelize"]
}
这篇关于如何通过Kotlin Android扩展插件禁用合成视图属性的生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!