Open whataa opened 6 years ago
编译时如果出现该错误,请检查是否因为你在gradle.properties中启用了:
android.databinding.enableV2
这是Android Gradle plugin在3.1.+版本新增的一个实验性的特性,并且不向后兼容;该特性在3.2.版本开始才默认启用,并且向后兼容。 具体的可以查看关于DataBinding V2的官方文档:New data binding compiler for binding classes
3.1.+
3.2.
也就是说,如果你的项目的Android Gradle plugin是3.1.+,就请不要开启该特性,即移除上述的配置语句。
由于com.android.tools.build:gradle:3.2.0 还未发布,所以我建议大家暂时不要开启DataBinding V2。
com.android.tools.build:gradle:3.2.0
参考issues:
编译时如果出现该错误,请检查是否因为你在gradle.properties中启用了:
这是Android Gradle plugin在
3.1.+
版本新增的一个实验性的特性,并且不向后兼容;该特性在3.2.
版本开始才默认启用,并且向后兼容。 具体的可以查看关于DataBinding V2的官方文档:New data binding compiler for binding classes也就是说,如果你的项目的Android Gradle plugin是3.1.+,就请不要开启该特性,即移除上述的配置语句。
由于
com.android.tools.build:gradle:3.2.0
还未发布,所以我建议大家暂时不要开启DataBinding V2。参考issues: