Error message when compiled as: cannot find implementation for package name.db.xxDatabase. xxDatabase_Impl does not exist

Error message when compiled by android studio:cannot find implementation for com.lwz.conn.db.MyDatabase. MyDatabase_Impl does not exist
Insert image description here
Solve the problem, steps:
The first step, if you use the kotlin project, don’t forget to quote it at the top kotlin-kapt plugin

apply plugin: 'kotlin-kapt'

In the second step, if you are using Kotlin language development, when importing dependent libraries, you need to use kapt to import the annotation processor.

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

You can view it after synchronization, as shown below:
Insert image description here

Guess you like

Origin blog.csdn.net/qq_35091074/article/details/134556158