【发布时间】:2021-03-05 14:36:39
【问题描述】:
我有一个使用数据绑定的项目:
buildFeatures {
dataBinding true
}
我改成之后:
buildFeatures {
dataBinding true
viewBinding true
}
gradle 同步很好,但是在尝试运行项目时我在数据绑定类中遇到错误:
:app:kaptHomologDebugKotlin
app/build/generated/source/kapt/homologDebug/br/com/test/DataBinderMapperImpl.java
cannot find symbol class ConfirmacaoFragmentBindingImpl
java.lang.reflect.InvocationTargetException (no error message)
Cannot find a setter for that accepts parameter type 'int'
我已经尝试过重建和无效缓存
documentation 说 “由于这些考虑,在某些情况下最好在项目中同时使用视图绑定和数据绑定”。
所以可以在一个项目中同时拥有两者
【问题讨论】:
标签: android data-binding android-viewbinding