as编译的报错提示:cannot find implementation for 包名.db.xxDatabase. xxDatabase_Impl does not exist

android studio编译的报错提示:cannot find implementation for com.lwz.conn.db.MyDatabase. MyDatabase_Impl does not exist
在这里插入图片描述
解决问题,步骤:
第一步骤,如果使用了kotlin项目,不要忘记在顶部引用kotlin-kapt插件

apply plugin: 'kotlin-kapt'

第二步骤,如果使用的是 Kotlin 语言开发 , 导入依赖库时 , 需要使用 kapt 导入注解处理器

kapt "androidx.room:room-compiler:$room_version"

同步后可以看,如下图:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_35091074/article/details/134556158