android - 工作室 3.2.1 中的 kapt 编译器问题,带有数据绑定和空间
问题描述
在所有生成的绑定类中构建失败并出现错误“找不到符号 DataBindingComponent”。如果我从我的模块 gradle 中删除房间编译器依赖项,那么它在运行时无法找到房间数据库,说“Db_Impl 不存在”。
def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
//kapt "android.arch.persistence.room:compiler:$room_version"
//kapt 'com.android.databinding:compiler:3.2.1'
解决方案
依赖项 { def room_version = "2.1.0-alpha06"
implementation "androidx.room:room-runtime:1.1.1"
annotationProcessor "androidx.room:room-compiler:1.1.1" // For Kotlin use kapt instead of annotationProcessor
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:1.1.1"
// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:1.1.1"
// optional - Guava support for Room, including Optional and ListenableFuture
implementation "androidx.room:room-guava:1.1.1"
// Test helpers
testImplementation "androidx.room:room-testing:1.1.1"
}
推荐阅读
- python - 如何使用 pystruct 获得顺序模型以输出概率
- python - 如何绕过 Tweepy 对推文提取的限制?
- c - sizeof char 指针和指向指针的指针
- mongodb - 子类别的架构设计
- haskell - 如何检查字符串是否可以在 Haskell 中解析为某种类型?
- reactjs - 如何修复“[ts] 属性 'getAttribute' 在类型 'EventTarget' 上不存在”
- python - 类型错误:在 include().django2.2.2 的情况下,视图必须是可调用的或列表/元组
- python - 如何在python的文本文件中附加浮点数?
- javascript - 如何将字符串转换为数组选择器的点表示法
- c# - c# 从 Form2 创建 Form1 的 MDI Child