MVC的一個老項目猾担,需要從另一個MVVM的項目里移植過來一些功能佳遣,新建了一個module開啟了databinding后報錯
ClassNotFoundException: Didn't find class "android.databinding.DataBinderMapperImpl" on path
谷歌之奸鸯,在Stack Overflow上看到一段提示:
Got my own lib and multiple apps. Had to add both to lib and app gradle files.
lib module與 app module都需要在gradle
文件中添加:
android {
....
dataBinding {
enabled = true
}
}