Android DataBinding 采坑记录

NoClassDefFoundError: Failed resolution of: Landroidx/databinding/DataBinderMapperImpl

app module 和 相关的 子 module 均需配置

1
2
3
4
5
6
android {

dataBinding {
enabled = true
}
}

Cause: couldn’t make a guess for xxx

1
Cause: couldn't make a guess for cc.androidx.app_widget.adapter.BaseRecyclerViewAdapter.entity.Person

错误分析: 问题出在type引用对象的包名包含了大写
解决方法: 包路径都为小写

1
2
3
4
5
6
7
8
9
<data>
<variable
name="person"
type="cc.androidx.app_widget.adapter.brva.entity.Person"/>

<variable
name="presenter"
type="cc.androidx.app_widget.adapter.brva.entity.PersonPresenter"/>
</data>

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :