Skip to content

cannot find symbol class DataBinderMapperImpl #1

@whataa

Description

@whataa

编译时如果出现该错误,请检查是否因为你在gradle.properties中启用了:

android.databinding.enableV2

这是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:

  1. DataBinderMapperImpl() is not generated
  2. Data Binding Compiler V2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions